using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Cicm.Database.Migrations { public partial class AddCompanyDescriptions : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable("CompanyDescriptions", table => new { Id = table.Column() .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), CompanyId = table.Column(), Text = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_CompanyDescriptions", x => x.Id); table.ForeignKey("FK_CompanyDescriptions_companies_CompanyId", x => x.CompanyId, "companies", "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex("IX_CompanyDescriptions_CompanyId", "CompanyDescriptions", "CompanyId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable("CompanyDescriptions"); } } }