using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PowderCoating.Infrastructure.Migrations { /// public partial class AddKioskIntakeSession : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "KioskActivationToken", table: "Companies", type: "nvarchar(max)", nullable: true); migrationBuilder.CreateTable( name: "KioskSessions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SessionToken = table.Column(type: "uniqueidentifier", nullable: false), SessionType = table.Column(type: "int", nullable: false), Status = table.Column(type: "int", nullable: false), CustomerFirstName = table.Column(type: "nvarchar(max)", nullable: false), CustomerLastName = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhone = table.Column(type: "nvarchar(max)", nullable: false), CustomerEmail = table.Column(type: "nvarchar(max)", nullable: false), IsReturningCustomer = table.Column(type: "bit", nullable: false), JobDescription = table.Column(type: "nvarchar(max)", nullable: false), HowDidYouHearAboutUs = table.Column(type: "nvarchar(max)", nullable: true), AgreedToTerms = table.Column(type: "bit", nullable: false), AgreedToTermsAt = table.Column(type: "datetime2", nullable: true), SmsOptIn = table.Column(type: "bit", nullable: false), SignatureDataBase64 = table.Column(type: "nvarchar(max)", nullable: true), LinkedCustomerId = table.Column(type: "int", nullable: true), LinkedJobId = table.Column(type: "int", nullable: true), SubmittedAt = table.Column(type: "datetime2", nullable: true), ExpiresAt = table.Column(type: "datetime2", nullable: false), RemoteLinkEmail = table.Column(type: "nvarchar(max)", nullable: true), RemoteLinkSentAt = table.Column(type: "datetime2", 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_KioskSessions", x => x.Id); table.ForeignKey( name: "FK_KioskSessions_Customers_LinkedCustomerId", column: x => x.LinkedCustomerId, principalTable: "Customers", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_KioskSessions_Jobs_LinkedJobId", column: x => x.LinkedJobId, principalTable: "Jobs", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8207)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8213)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 5, 13, 18, 40, 15, 633, DateTimeKind.Utc).AddTicks(8215)); migrationBuilder.CreateIndex( name: "IX_KioskSessions_LinkedCustomerId", table: "KioskSessions", column: "LinkedCustomerId"); migrationBuilder.CreateIndex( name: "IX_KioskSessions_LinkedJobId", table: "KioskSessions", column: "LinkedJobId"); migrationBuilder.CreateIndex( name: "IX_KioskSessions_SessionToken", table: "KioskSessions", column: "SessionToken", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "KioskSessions"); migrationBuilder.DropColumn( name: "KioskActivationToken", table: "Companies"); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5641)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5655)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 5, 13, 14, 57, 30, 15, DateTimeKind.Utc).AddTicks(5656)); } } }