2019-06-17 03:50:32 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
2020-02-10 02:10:18 +00:00
|
|
|
|
namespace Marechai.Database.Migrations
|
2019-06-17 03:50:32 +01:00
|
|
|
|
{
|
|
|
|
|
|
public partial class AddMagazineIssues : Migration
|
|
|
|
|
|
{
|
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
|
{
|
2020-02-10 22:44:18 +00:00
|
|
|
|
migrationBuilder.CreateTable("MagazineIssues", table => new
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = table.Column<long>().
|
|
|
|
|
|
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2020-08-05 21:00:35 +01:00
|
|
|
|
MagazineId = table.Column<long>(),
|
|
|
|
|
|
Caption = table.Column<string>(),
|
2020-02-10 22:44:18 +00:00
|
|
|
|
NativeCaption = table.Column<string>(nullable: true),
|
|
|
|
|
|
Published = table.Column<DateTime>(nullable: true),
|
2020-08-05 21:00:35 +01:00
|
|
|
|
ProductCode = table.Column<string>(maxLength: 18, nullable: true),
|
|
|
|
|
|
Pages = table.Column<short>()
|
2020-02-10 22:44:18 +00:00
|
|
|
|
}, constraints: table =>
|
|
|
|
|
|
{
|
|
|
|
|
|
table.PrimaryKey("PK_MagazineIssues", x => x.Id);
|
|
|
|
|
|
|
|
|
|
|
|
table.ForeignKey("FK_MagazineIssues_Magazines_MagazineId", x => x.MagazineId, "Magazines", "Id",
|
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
|
});
|
2019-06-17 03:50:32 +01:00
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_Caption", "MagazineIssues", "Caption");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_MagazineId", "MagazineIssues", "MagazineId");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_NativeCaption", "MagazineIssues", "NativeCaption");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_Pages", "MagazineIssues", "Pages");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_ProductCode", "MagazineIssues", "ProductCode");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex("IX_MagazineIssues_Published", "MagazineIssues", "Published");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-02-10 22:44:18 +00:00
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MagazineIssues");
|
2019-06-17 03:50:32 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|