Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
10 KiB
Tasks: Migrate Database Schema
Phase 0: Foundation Tables (Corrected)
-
001: Search table migration script
- Source:
OLD/Database/Tables/Search.sql - Note: Corrected to match legacy schema (ID, UserName, Name, Status, SubmitDT, StartDT, EndDT, Criteria, Results)
- Location:
NEW/src/JdeScoping.Database/Scripts/001_CreateSearchTable.sql
- Source:
-
002: DataUpdate table migration script
- Source:
OLD/Database/Tables/DataUpdate.sql - Note: Corrected to match legacy schema (SourceSystem, SourceData, TableName, StartDT, EndDT, UpdateType, WasSuccessful, NumberRecords)
- Location:
NEW/src/JdeScoping.Database/Scripts/002_CreateDataUpdateTable.sql
- Source:
Phase 1: Reference Tables (No Dependencies)
-
003: Create Branch table migration script
- Source:
OLD/Database/Tables/Branch.sql - Location:
NEW/src/JdeScoping.Database/Scripts/003_CreateBranchTable.sql
- Source:
-
004: Create StatusCode table migration script
- Source:
OLD/Database/Tables/StatusCode.sql - Location:
NEW/src/JdeScoping.Database/Scripts/004_CreateStatusCodeTable.sql
- Source:
-
005: Create FunctionCode table migration script
- Source:
OLD/Database/Tables/FunctionCode.sql - Location:
NEW/src/JdeScoping.Database/Scripts/005_CreateFunctionCodeTable.sql
- Source:
-
006: Create ProfitCenter table migration script
- Source:
OLD/Database/Tables/ProfitCenter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/006_CreateProfitCenterTable.sql
- Source:
-
007: Create WorkCenter table migration script
- Source:
OLD/Database/Tables/WorkCenter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/007_CreateWorkCenterTable.sql
- Source:
-
008: Create Item table migration script
- Source:
OLD/Database/Tables/Item.sql - Location:
NEW/src/JdeScoping.Database/Scripts/008_CreateItemTable.sql
- Source:
-
009: Create JdeUser table migration script
- Source:
OLD/Database/Tables/JdeUser.sql - Location:
NEW/src/JdeScoping.Database/Scripts/009_CreateJdeUserTable.sql
- Source:
-
010: Create OrgHierarchy table migration script
- Source:
OLD/Database/Tables/OrgHierarchy.sql - Location:
NEW/src/JdeScoping.Database/Scripts/010_CreateOrgHierarchyTable.sql
- Source:
-
011: Create RouteMaster table migration script
- Source:
OLD/Database/Tables/RouteMaster.sql - Location:
NEW/src/JdeScoping.Database/Scripts/011_CreateRouteMasterTable.sql
- Source:
-
012: Create MisData table migration script
- Source:
OLD/Database/Tables/MisData.sql - Location:
NEW/src/JdeScoping.Database/Scripts/012_CreateMisDataTable.sql
- Source:
Phase 2: Core Tables (Depend on Reference Tables)
-
013: Create Lot table migration script
- Source:
OLD/Database/Tables/Lot.sql - Location:
NEW/src/JdeScoping.Database/Scripts/013_CreateLotTable.sql
- Source:
-
014: Create LotLocation table migration script
- Source:
OLD/Database/Tables/LotLocation.sql - Location:
NEW/src/JdeScoping.Database/Scripts/014_CreateLotLocationTable.sql
- Source:
-
015: Create WorkOrder_Curr table migration script
- Source:
OLD/Database/Tables/WorkOrder_Curr.sql - Location:
NEW/src/JdeScoping.Database/Scripts/015_CreateWorkOrderCurrTable.sql
- Source:
-
016: Create WorkOrder_Hist table migration script
- Source:
OLD/Database/Tables/WorkOrder_Hist.sql - Location:
NEW/src/JdeScoping.Database/Scripts/016_CreateWorkOrderHistTable.sql
- Source:
-
017: Create WorkOrderStep_Curr table migration script
- Source:
OLD/Database/Tables/WorkOrderStep_Curr.sql - Location:
NEW/src/JdeScoping.Database/Scripts/017_CreateWorkOrderStepCurrTable.sql
- Source:
-
018: Create WorkOrderStep_Hist table migration script
- Source:
OLD/Database/Tables/WorkOrderStep_Hist.sql - Location:
NEW/src/JdeScoping.Database/Scripts/018_CreateWorkOrderStepHistTable.sql
- Source:
-
019: Create WorkOrderTime_Curr table migration script
- Source:
OLD/Database/Tables/WorkOrderTime_Curr.sql - Location:
NEW/src/JdeScoping.Database/Scripts/019_CreateWorkOrderTimeCurrTable.sql
- Source:
-
020: Create WorkOrderTime_Hist table migration script
- Source:
OLD/Database/Tables/WorkOrderTime_Hist.sql - Location:
NEW/src/JdeScoping.Database/Scripts/020_CreateWorkOrderTimeHistTable.sql
- Source:
-
021: Create WorkOrderComponent_Curr table migration script
- Source:
OLD/Database/Tables/WorkOrderComponent_Curr.sql - Location:
NEW/src/JdeScoping.Database/Scripts/021_CreateWorkOrderComponentCurrTable.sql
- Source:
-
022: Create WorkOrderComponent_Hist table migration script
- Source:
OLD/Database/Tables/WorkOrderComponent_Hist.sql - Location:
NEW/src/JdeScoping.Database/Scripts/022_CreateWorkOrderComponentHistTable.sql
- Source:
-
023: Create WorkOrderRouting table migration script
- Source:
OLD/Database/Tables/WorkOrderRouting_Curr.sql - Note: File creates
dbo.WorkOrderRouting(no _Curr suffix, single table) - Location:
NEW/src/JdeScoping.Database/Scripts/023_CreateWorkOrderRoutingTable.sql
- Source:
-
024: Create LotUsage_Curr table migration script
- Source:
OLD/Database/Tables/LotUsage_Curr.sql - Location:
NEW/src/JdeScoping.Database/Scripts/024_CreateLotUsageCurrTable.sql
- Source:
-
025: Create LotUsage_Hist table migration script
- Source:
OLD/Database/Tables/LotUsage_Hist.sql - Location:
NEW/src/JdeScoping.Database/Scripts/025_CreateLotUsageHistTable.sql
- Source:
Phase 3: Views (Depend on Tables)
-
026: Create WorkOrder view migration script
- Source:
OLD/Database/Views/WorkOrder.sql - Location:
NEW/src/JdeScoping.Database/Scripts/026_CreateWorkOrderView.sql
- Source:
-
027: Create WorkOrderTime view migration script
- Source:
OLD/Database/Views/WorkOrderTime.sql - Location:
NEW/src/JdeScoping.Database/Scripts/027_CreateWorkOrderTimeView.sql
- Source:
-
028: Create WorkOrderStep view migration script
- Source:
OLD/Database/Views/WorkOrderStep.sql - Location:
NEW/src/JdeScoping.Database/Scripts/028_CreateWorkOrderStepView.sql
- Source:
-
029: Create WorkOrderComponent view migration script
- Source:
OLD/Database/Views/WorkOrderComponent.sql - Location:
NEW/src/JdeScoping.Database/Scripts/029_CreateWorkOrderComponentView.sql
- Source:
-
030: Create LotUsage view migration script
- Source:
OLD/Database/Views/LotUsage.sql - Location:
NEW/src/JdeScoping.Database/Scripts/030_CreateLotUsageView.sql
- Source:
-
031: Create WorkOrderTotalScrap view migration script
- Source:
OLD/Database/Views/WorkOrderTotalScrap.sql - Location:
NEW/src/JdeScoping.Database/Scripts/031_CreateWorkOrderTotalScrapView.sql
- Source:
-
032: Create LastDataUpdates view migration script
- Source:
OLD/Database/Views/LastDataUpdates.sql - Location:
NEW/src/JdeScoping.Database/Scripts/032_CreateLastDataUpdatesView.sql
- Source:
Phase 4: Table-Valued Parameter Types
-
033: Create WorkOrderFilterParameter type migration script
- Source:
OLD/Database/Types/WorkOrderFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/033_CreateWorkOrderFilterParameterType.sql
- Source:
-
034: Create ItemNumberFilterParameter type migration script
- Source:
OLD/Database/Types/ItemNumberFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/034_CreateItemNumberFilterParameterType.sql
- Source:
-
035: Create ProfitCenterFilterParameter type migration script
- Source:
OLD/Database/Types/ProfitCenterFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/035_CreateProfitCenterFilterParameterType.sql
- Source:
-
036: Create WorkCenterFilterParameter type migration script
- Source:
OLD/Database/Types/WorkCenterFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/036_CreateWorkCenterFilterParameterType.sql
- Source:
-
037: Create OperatorFilterParameter type migration script
- Source:
OLD/Database/Types/OperatorFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/037_CreateOperatorFilterParameterType.sql
- Source:
-
038: Create ComponentLotFilterParameter type migration script
- Source:
OLD/Database/Types/ComponentLotFilterParameter.sql - Location:
NEW/src/JdeScoping.Database/Scripts/038_CreateComponentLotFilterParameterType.sql
- Source:
-
039: Create ItemOperationMisFilterParameter type migration script
- Source:
OLD/Database/Types/ItemOperationMISFilterParameter.sql - Note: Using lowercase "Mis" per Codex review naming convention
- Location:
NEW/src/JdeScoping.Database/Scripts/039_CreateItemOperationMisFilterParameterType.sql
- Source:
Phase 5: Stored Procedures
-
040: Create SubmitSearch stored procedure migration script
- Source:
OLD/Database/StoredProcedures/SubmitSearch.sql - Location:
NEW/src/JdeScoping.Database/Scripts/040_CreateSubmitSearchProcedure.sql
- Source:
-
041: Create StartSearch stored procedure migration script
- Source:
OLD/Database/StoredProcedures/StartSearch.sql - Location:
NEW/src/JdeScoping.Database/Scripts/041_CreateStartSearchProcedure.sql
- Source:
-
042: Create CompleteSearch stored procedure migration script
- Source:
OLD/Database/StoredProcedures/CompleteSearch.sql - Location:
NEW/src/JdeScoping.Database/Scripts/042_CreateCompleteSearchProcedure.sql
- Source:
-
043: Create ResetPartialSearches stored procedure migration script
- Source:
OLD/Database/StoredProcedures/ResetPartialSearches.sql - Location:
NEW/src/JdeScoping.Database/Scripts/043_CreateResetPartialSearchesProcedure.sql
- Source:
Phase 6: Functions
- 044: Create MatchMis table-valued function migration script
- Source:
OLD/Database/Functions/MatchMis.sql - Dependencies: Item, WorkOrder, WorkOrderRouting, RouteMaster, MisData tables
- Location:
NEW/src/JdeScoping.Database/Scripts/044_CreateMatchMisFunction.sql
- Source:
Phase 7: Verification
-
045: Run full migration against clean database
- Validation: All 44 scripts executed in order without error
- Command:
dotnet run --project NEW/src/JdeScoping.Host
-
046: Verify all objects exist
- Validation: Query sys.tables, sys.views, sys.procedures, sys.types
- Results: 26 tables (25 + SchemaVersions), 7 views, 7 types, 4 procedures, 1 function
-
047: Codex MCP review of migration scripts
- All scripts verified against legacy source during creation
- DATETIME -> DATETIME2(7) conversion applied consistently