using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations { /// public partial class RetireInboundApiKeyStore : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ApiKeys"); migrationBuilder.DropColumn( name: "ApprovedApiKeyIds", table: "ApiMethods"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ApprovedApiKeyIds", table: "ApiMethods", type: "nvarchar(4000)", maxLength: 4000, nullable: true); migrationBuilder.CreateTable( name: "ApiKeys", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), IsEnabled = table.Column(type: "bit", nullable: false), KeyHash = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) }, constraints: table => { table.PrimaryKey("PK_ApiKeys", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_ApiKeys_KeyHash", table: "ApiKeys", column: "KeyHash", unique: true); migrationBuilder.CreateIndex( name: "IX_ApiKeys_Name", table: "ApiKeys", column: "Name", unique: true); } } }