26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
2.2 KiB
2.2 KiB
Migrate Database Schema
Summary
Migrate all SQL Server database objects from the legacy .sqlproj to DbUp migration scripts in the new .NET 10 solution. This establishes the data layer foundation for subsequent migration phases.
Scope
In Scope
- 25 tables (23 remaining - Search and DataUpdate already migrated)
- 7 views (union views for _Curr/_Hist tables, aggregation views)
- 7 table-valued parameter types (filter parameters for search queries)
- 4 stored procedures (SubmitSearch, StartSearch, CompleteSearch, ResetPartialSearches)
- 1 table-valued function (MatchMis)
Out of Scope
- Application code changes
- Connection string configuration
- Data migration from existing databases
- Index optimization (will be addressed separately)
Why
The legacy .sqlproj format is not compatible with .NET 10 and cross-platform development. DbUp provides:
- Version-controlled, sequential migrations
- Idempotent deployments
- Cross-platform compatibility
- Integration with application startup
What Changes
- Added: 44 DbUp migration scripts in
NEW/src/JdeScoping.Database/Scripts/ - Modified: All DATETIME columns converted to DATETIME2(7) for better precision
- Added: Spec requirements for DbUp migration patterns and idempotency
Acceptance Criteria
- All 44 database objects exist as numbered DbUp migration scripts
- Scripts run successfully against empty database
- Scripts are idempotent (can re-run without error)
- Schema matches legacy database with approved modernizations:
- DATETIME → DATETIME2(7) for better precision
- Non-clustered indexes included in table scripts
openspec validate migrate-database-schema --strictpasses
Dependencies
- None (this is the foundation phase)
Risks
| Risk | Mitigation |
|---|---|
| Schema drift from legacy | Codex MCP review against OLD/Database/ files |
| Missing dependencies between objects | Order scripts by dependency (tables → views → types → procs) |
| Data type mismatches | Use exact types from legacy schema |
Related Specs
database-schema- Table definitions and relationshipssql-views-types- Views and TVP typessql-business-logic- Stored procedures and functions