This commit is contained in:
Paul Schneider 2024-12-14 20:21:41 +00:00
commit fdf5ee915e
67 changed files with 48812 additions and 37055 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,125 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class commentReceiver : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BlogTrad");
migrationBuilder.DropColumn(
name: "Lang",
table: "Blogspot");
migrationBuilder.RenameColumn(
name: "PostId",
table: "Comment",
newName: "ReceiverId"
);
migrationBuilder.AlterColumn<string>(
name: "Title",
table: "Blogspot",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Photo",
table: "Blogspot",
type: "character varying(1024)",
maxLength: 1024,
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Content",
table: "Blogspot",
type: "character varying(56224)",
maxLength: 56224,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "ReceiverId",
table: "Comment",
newName: "PostId");
migrationBuilder.AlterColumn<string>(
name: "Title",
table: "Blogspot",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(1024)",
oldMaxLength: 1024);
migrationBuilder.AlterColumn<string>(
name: "Photo",
table: "Blogspot",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(1024)",
oldMaxLength: 1024,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Content",
table: "Blogspot",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(56224)",
oldMaxLength: 56224);
migrationBuilder.AddColumn<string>(
name: "Lang",
table: "Blogspot",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "BlogTrad",
columns: table => new
{
PostId = table.Column<long>(type: "bigint", nullable: false),
Lang = table.Column<string>(type: "text", nullable: false),
TraducerId = table.Column<string>(type: "text", nullable: false),
Body = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BlogTrad", x => new { x.PostId, x.Lang });
table.ForeignKey(
name: "FK_BlogTrad_AspNetUsers_TraducerId",
column: x => x.TraducerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_BlogTrad_TraducerId",
table: "BlogTrad",
column: "TraducerId");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,61 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class commentParent : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Comment_Blogspot_PostId",
table: "Comment");
migrationBuilder.DropIndex(
name: "IX_Comment_PostId",
table: "Comment");
migrationBuilder.CreateIndex(
name: "IX_Comment_ReceiverId",
table: "Comment",
column: "ReceiverId");
migrationBuilder.AddForeignKey(
name: "FK_Comment_Blogspot_ReceiverId",
table: "Comment",
column: "ReceiverId",
principalTable: "Blogspot",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Comment_Blogspot_ReceiverId",
table: "Comment");
migrationBuilder.DropIndex(
name: "IX_Comment_ReceiverId",
table: "Comment");
migrationBuilder.CreateIndex(
name: "IX_Comment_PostId",
table: "Comment",
column: "PostId");
migrationBuilder.AddForeignKey(
name: "FK_Comment_Blogspot_PostId",
table: "Comment",
column: "PostId",
principalTable: "Blogspot",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -712,7 +712,8 @@ namespace Yavsc.Migrations
b.Property<string>("Content")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(56224)
.HasColumnType("character varying(56224)");
b.Property<DateTime>("DateCreated")
.HasColumnType("timestamp with time zone");
@ -720,20 +721,17 @@ namespace Yavsc.Migrations
b.Property<DateTime>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<string>("Lang")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Photo")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<int>("Rate")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("UserCreated")
.IsRequired()
@ -793,7 +791,7 @@ namespace Yavsc.Migrations
b.Property<long?>("ParentId")
.HasColumnType("bigint");
b.Property<long>("PostId")
b.Property<long>("ReceiverId")
.HasColumnType("bigint");
b.Property<string>("UserCreated")
@ -813,7 +811,7 @@ namespace Yavsc.Migrations
b.HasIndex("ParentId");
b.HasIndex("PostId");
b.HasIndex("ReceiverId");
b.ToTable("Comment");
});
@ -2354,33 +2352,6 @@ namespace Yavsc.Migrations
b.ToTable("UserActivities");
});
modelBuilder.Entity("Yavsc.Server.Models.Blog.BlogTrad", b =>
{
b.Property<long>("PostId")
.HasColumnType("bigint");
b.Property<string>("Lang")
.HasColumnType("text");
b.Property<string>("Body")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TraducerId")
.IsRequired()
.HasColumnType("text");
b.HasKey("PostId", "Lang");
b.HasIndex("TraducerId");
b.ToTable("BlogTrad");
});
modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b =>
{
b.Property<DateTime>("Start")
@ -2801,7 +2772,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Blog.BlogPost", "Post")
.WithMany("Comments")
.HasForeignKey("PostId")
.HasForeignKey("ReceiverId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@ -3353,17 +3324,6 @@ namespace Yavsc.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Yavsc.Server.Models.Blog.BlogTrad", b =>
{
b.HasOne("Yavsc.Models.ApplicationUser", "Traducer")
.WithMany()
.HasForeignKey("TraducerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Traducer");
});
modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b =>
{
b.HasOne("Yavsc.Models.Workflow.Activity", "Context")