using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PowderCoating.Infrastructure.Migrations { /// public partial class AddJobTimeEntries : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "JobTimeEntries", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), JobId = table.Column(type: "int", nullable: false), ShopWorkerId = table.Column(type: "int", nullable: false), WorkDate = table.Column(type: "datetime2", nullable: false), HoursWorked = table.Column(type: "decimal(18,2)", nullable: false), Stage = table.Column(type: "nvarchar(max)", nullable: true), Notes = table.Column(type: "nvarchar(max)", 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_JobTimeEntries", x => x.Id); table.ForeignKey( name: "FK_JobTimeEntries_Jobs_JobId", column: x => x.JobId, principalTable: "Jobs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_JobTimeEntries_ShopWorkers_ShopWorkerId", column: x => x.ShopWorkerId, principalTable: "ShopWorkers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2691)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2697)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2699)); migrationBuilder.CreateIndex( name: "IX_JobTimeEntries_JobId", table: "JobTimeEntries", column: "JobId"); migrationBuilder.CreateIndex( name: "IX_JobTimeEntries_ShopWorkerId", table: "JobTimeEntries", column: "ShopWorkerId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "JobTimeEntries"); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 1, column: "CreatedAt", value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3737)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 2, column: "CreatedAt", value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3746)); migrationBuilder.UpdateData( table: "PricingTiers", keyColumn: "Id", keyValue: 3, column: "CreatedAt", value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3748)); } } }