mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 08:23:12 +00:00
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.
37 lines
1.1 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|