mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace Marechai.Database.Migrations
|
|
{
|
|
public partial class AddCompanyDescriptions : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable("CompanyDescriptions", table => new
|
|
{
|
|
Id = table.Column<int>().
|
|
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
CompanyId = table.Column<int>(),
|
|
Text = table.Column<string>(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");
|
|
}
|
|
} |