using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PowderCoating.Infrastructure.Migrations { /// public partial class AddPlatformSettings : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "PlatformSettings", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Key = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: true), Label = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), GroupName = table.Column(type: "nvarchar(max)", nullable: true), UpdatedAt = table.Column(type: "datetime2", nullable: true), UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PlatformSettings", x => x.Id); }); // Unique index on Key migrationBuilder.CreateIndex( name: "IX_PlatformSettings_Key", table: "PlatformSettings", column: "Key", unique: true); // Seed default platform settings migrationBuilder.InsertData( table: "PlatformSettings", columns: ["Id", "Key", "Value", "Label", "Description", "GroupName"], values: new object[,] { { 1, "AdminNotificationEmail", null, "Admin Notification Email", "Email address that receives platform event notifications (new signups, bug reports, subscription events). Leave blank to disable.", "Notifications" } }); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(443)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(449)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(450)); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "IX_PlatformSettings_Key", table: "PlatformSettings"); migrationBuilder.DropTable( name: "PlatformSettings"); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2744)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2750)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2752)); } } }