Files
everything2/EveryThing/Migrations/20230523103144_2.cs
David Štaleker 257f8730b2 Napol
2023-05-23 14:57:29 +02:00

58 lines
2.2 KiB
C#

using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EveryThing.Migrations
{
public partial class _2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Type",
table: "CodeTablePrePostText");
migrationBuilder.CreateTable(
name: "CodeTablePrePostTextLink",
columns: table => new
{
IdPrePostTextLink = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
IdPrePostTextFk = table.Column<int>(type: "int", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
Link = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CodeTablePrePostTextLink", x => x.IdPrePostTextLink);
table.ForeignKey(
name: "FK_CodeTablePrePostTextLink_CodeTablePrePostText_IdPrePostTextFk",
column: x => x.IdPrePostTextFk,
principalTable: "CodeTablePrePostText",
principalColumn: "IdPrePostText",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_CodeTablePrePostTextLink_IdPrePostTextFk",
table: "CodeTablePrePostTextLink",
column: "IdPrePostTextFk");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CodeTablePrePostTextLink");
migrationBuilder.AddColumn<string>(
name: "Type",
table: "CodeTablePrePostText",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}