shoc-backend/Data.SeaHavenIndustries/Migrations/20260730150000_WoIsAddOn.cs
Arthur Bassi 97e042f552 feat(work-orders): persist IsAddOn frozen at create (SH-126)
Add set-once IsAddOn with server cutoff at create, board DTO exposure, legacy type-7 backfill, and Types=AddOn search compat. Aligns with FE PR #61 frozen contract.
2026-08-13 13:30:09 -03:00

37 lines
1.1 KiB
C#

using Data.SeaHavenIndustries;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260730150000_WoIsAddOn")]
public partial class WoIsAddOn : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsAddOn",
table: "workOrders",
type: "bit",
nullable: false,
defaultValue: false);
// Legacy WorkOrderType.AddOn (7) → flag; do not remap type (real type unknown).
migrationBuilder.Sql(
"UPDATE workOrders SET IsAddOn = 1 WHERE WorkOrderType = 7;");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsAddOn",
table: "workOrders");
}
}
}