using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PowderCoating.Infrastructure.Migrations { /// public partial class AddInAppNotifications : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "InAppNotifications", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Title = table.Column(type: "nvarchar(max)", nullable: false), Message = table.Column(type: "nvarchar(max)", nullable: false), Link = table.Column(type: "nvarchar(max)", nullable: true), NotificationType = table.Column(type: "nvarchar(max)", nullable: false), IsRead = table.Column(type: "bit", nullable: false), ReadAt = table.Column(type: "datetime2", nullable: true), QuoteId = table.Column(type: "int", nullable: true), InvoiceId = table.Column(type: "int", nullable: true), CustomerId = table.Column(type: "int", nullable: true), CompanyId = table.Column(type: "int", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), UpdatedAt = table.Column(type: "datetime2", nullable: true), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false), DeletedAt = table.Column(type: "datetime2", nullable: true), DeletedBy = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_InAppNotifications", x => x.Id); table.ForeignKey( name: "FK_InAppNotifications_Customers_CustomerId", column: x => x.CustomerId, principalTable: "Customers", principalColumn: "Id"); table.ForeignKey( name: "FK_InAppNotifications_Invoices_InvoiceId", column: x => x.InvoiceId, principalTable: "Invoices", principalColumn: "Id"); table.ForeignKey( name: "FK_InAppNotifications_Quotes_QuoteId", column: x => x.QuoteId, principalTable: "Quotes", principalColumn: "Id"); }); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(787)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(794)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(795)); migrationBuilder.CreateIndex( name: "IX_InAppNotifications_CustomerId", table: "InAppNotifications", column: "CustomerId"); migrationBuilder.CreateIndex( name: "IX_InAppNotifications_InvoiceId", table: "InAppNotifications", column: "InvoiceId"); migrationBuilder.CreateIndex( name: "IX_InAppNotifications_QuoteId", table: "InAppNotifications", column: "QuoteId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "InAppNotifications"); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7842)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7847)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7849)); } } }