using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SanctionsSearch.Worker.Migrations { /// public partial class initial_migration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Sdns", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), Type = table.Column(type: "TEXT", nullable: false), Program = table.Column(type: "TEXT", nullable: false), Title = table.Column(type: "TEXT", nullable: false), CallSign = table.Column(type: "TEXT", nullable: false), VesselType = table.Column(type: "TEXT", nullable: false), Tonnage = table.Column(type: "TEXT", nullable: false), GrossRegisteredTonnage = table.Column(type: "TEXT", nullable: false), VesselFlag = table.Column(type: "TEXT", nullable: false), VesselOwner = table.Column(type: "TEXT", nullable: false), Remarks = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Sdns", x => x.Id); }); migrationBuilder.CreateTable( name: "Addresses", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SdnId = table.Column(type: "INTEGER", nullable: false), StreetAddress = table.Column(type: "TEXT", nullable: false), CityProvincePostal = table.Column(type: "TEXT", nullable: false), Country = table.Column(type: "TEXT", nullable: false), Remarks = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); table.ForeignKey( name: "FK_Addresses_Sdns_SdnId", column: x => x.SdnId, principalTable: "Sdns", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Aliases", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SdnId = table.Column(type: "INTEGER", nullable: false), Type = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Remarks = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Aliases", x => x.Id); table.ForeignKey( name: "FK_Aliases_Sdns_SdnId", column: x => x.SdnId, principalTable: "Sdns", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Comments", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SdnId = table.Column(type: "INTEGER", nullable: false), Remarks = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Comments", x => x.Id); table.ForeignKey( name: "FK_Comments_Sdns_SdnId", column: x => x.SdnId, principalTable: "Sdns", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Addresses_SdnId", table: "Addresses", column: "SdnId"); migrationBuilder.CreateIndex( name: "IX_Aliases_SdnId", table: "Aliases", column: "SdnId"); migrationBuilder.CreateIndex( name: "IX_Comments_SdnId", table: "Comments", column: "SdnId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Addresses"); migrationBuilder.DropTable( name: "Aliases"); migrationBuilder.DropTable( name: "Comments"); migrationBuilder.DropTable( name: "Sdns"); } } }