mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-06 15:52:09 +00:00
fix(migrations): remove undiscoverable WorkOrderType backfill migration
Superseded by Phase0 (WorkOrderType as int) and Phase1 board indexes; keeping the bare Migration would either be skipped by EF or conflict if metadata were added.
This commit is contained in:
parent
bdfaf1ff61
commit
3122cbc8f7
1 changed files with 0 additions and 43 deletions
|
|
@ -1,43 +0,0 @@
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Data.SeaHavenIndustries.Migrations
|
|
||||||
{
|
|
||||||
public class AddWorkOrderTypeAndScheduledDateIndex : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.Sql("""
|
|
||||||
IF COL_LENGTH('workOrders', 'WorkOrderType') IS NULL
|
|
||||||
ALTER TABLE workOrders ADD WorkOrderType varchar(50) NULL;
|
|
||||||
""");
|
|
||||||
|
|
||||||
migrationBuilder.Sql("""
|
|
||||||
IF NOT EXISTS (
|
|
||||||
SELECT 1 FROM sys.indexes
|
|
||||||
WHERE name = 'IX_workOrders_ScheduledDate'
|
|
||||||
AND object_id = OBJECT_ID('workOrders'))
|
|
||||||
BEGIN
|
|
||||||
CREATE INDEX IX_workOrders_ScheduledDate ON workOrders (ScheduledDate);
|
|
||||||
END
|
|
||||||
""");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.Sql("""
|
|
||||||
IF EXISTS (
|
|
||||||
SELECT 1 FROM sys.indexes
|
|
||||||
WHERE name = 'IX_workOrders_ScheduledDate'
|
|
||||||
AND object_id = OBJECT_ID('workOrders'))
|
|
||||||
DROP INDEX IX_workOrders_ScheduledDate ON workOrders;
|
|
||||||
""");
|
|
||||||
|
|
||||||
migrationBuilder.Sql("""
|
|
||||||
IF COL_LENGTH('workOrders', 'WorkOrderType') IS NOT NULL
|
|
||||||
ALTER TABLE workOrders DROP COLUMN WorkOrderType;
|
|
||||||
""");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue