2019-05-18 17:12:54 +01:00
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
2020-02-10 02:10:18 +00:00
|
|
|
|
namespace Marechai.Database.Migrations
|
2019-05-18 17:12:54 +01:00
|
|
|
|
{
|
|
|
|
|
|
public partial class RemoveCompanyDescriptions : Migration
|
|
|
|
|
|
{
|
2020-02-10 22:44:18 +00:00
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder) =>
|
2019-05-18 17:12:54 +01:00
|
|
|
|
migrationBuilder.DropTable("company_descriptions");
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
|
{
|
2020-02-10 22:44:18 +00:00
|
|
|
|
migrationBuilder.CreateTable("company_descriptions", table => new
|
|
|
|
|
|
{
|
|
|
|
|
|
id = table.Column<int>("int(11)").
|
|
|
|
|
|
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2020-08-05 21:00:35 +01:00
|
|
|
|
company_id = table.Column<int>("int(11)"),
|
|
|
|
|
|
text = table.Column<string>("text", nullable: true)
|
2020-02-10 22:44:18 +00:00
|
|
|
|
}, constraints: table =>
|
|
|
|
|
|
{
|
|
|
|
|
|
table.PrimaryKey("PK_company_descriptions", x => x.id);
|
|
|
|
|
|
table.ForeignKey("fk_company_id", x => x.id, "companies", "id", onDelete: ReferentialAction.Cascade);
|
|
|
|
|
|
});
|
2019-05-18 17:12:54 +01:00
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("idx_company_id", "company_descriptions", "company_id", unique: true);
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("idx_text", "company_descriptions", "text");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|