using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Hcs.WebApp.Data.Hcs.Migrations { /// public partial class AddSupplyContractEntity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "SupplyContracts", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), HcsId = table.Column(type: "uniqueidentifier", nullable: true), ThirdPartyId = table.Column(type: "nvarchar(max)", nullable: true), SyncedAt = table.Column(type: "datetime2", nullable: true), LastSyncOperationId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SupplyContracts", x => x.Id); table.ForeignKey( name: "FK_SupplyContracts_Operations_LastSyncOperationId", column: x => x.LastSyncOperationId, principalTable: "Operations", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_SupplyContracts_LastSyncOperationId", table: "SupplyContracts", column: "LastSyncOperationId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SupplyContracts"); } } }