using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Hcs.WebApp.Data.Hcs.Migrations { /// public partial class AddHouseEntity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Houses", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), FiasId = table.Column(type: "uniqueidentifier", nullable: false), ThirdPartyId = table.Column(type: "int", nullable: false), IsMkd = table.Column(type: "bit", nullable: false), IsZhd = table.Column(type: "bit", nullable: false), SyncedAt = table.Column(type: "datetime2", nullable: true), LastSyncOperationId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Houses", x => x.Id); table.ForeignKey( name: "FK_Houses_Operations_LastSyncOperationId", column: x => x.LastSyncOperationId, principalTable: "Operations", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Houses_FiasId", table: "Houses", column: "FiasId", unique: true); migrationBuilder.CreateIndex( name: "IX_Houses_LastSyncOperationId", table: "Houses", column: "LastSyncOperationId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Houses"); } } }