Files
workspace/code/fms/fms-api/config/migrations
2026-08-04 17:31:27 +08:00
..
2026-08-04 17:31:27 +08:00
2026-07-29 17:33:21 +08:00
2026-07-28 22:54:43 +08:00
2026-07-26 22:52:21 +08:00
2026-07-30 17:30:13 +08:00
2026-07-26 22:52:21 +08:00
2026-07-27 22:51:41 +08:00
2026-07-28 17:30:27 +08:00
2026-07-29 17:33:21 +08:00
2026-07-29 17:33:21 +08:00
2026-07-29 23:18:54 +08:00
2026-07-29 17:33:21 +08:00
2026-07-29 23:18:54 +08:00
2026-07-29 23:18:54 +08:00
2026-07-30 23:11:10 +08:00
2026-07-29 23:18:54 +08:00
2026-07-29 23:18:54 +08:00
2026-07-29 23:18:54 +08:00
2026-07-29 23:18:54 +08:00
2026-07-30 23:11:10 +08:00
2026-07-30 23:11:10 +08:00
2026-08-02 22:05:44 +08:00
2026-08-02 22:05:44 +08:00
2026-08-04 17:31:27 +08:00
2026-08-04 17:31:27 +08:00
2026-08-04 17:31:27 +08:00
2026-07-29 23:18:54 +08:00
2026-08-03 22:54:03 +08:00

Database migrations

Module architecture cutover is manual and is not run during application startup.

Run against a backed-up FMS database in this order:

  1. 033_create_module_structure.sql
  2. 034_module_runtime_views.sql
  3. verify_module_architecture.sql

033 is a one-time transaction: it migrates valid metadata and removes the old metadata tables only after conversion checks pass. It intentionally does not create compatibility views or dual writes. If the earlier intermediate implementation created only s_module_profile, s_function_node, or s_page_node, 033 verifies that the complete source model still exists and regenerates those derived tables inside the same transaction. Other partial target states are rejected.

033 and 034 use SQL Server GO batch separators. Use SSMS, Azure Data Studio, sqlcmd, or another runner that understands GO.

verify_module_architecture.sql is a target-schema verification script. It does not modify application tables.

To check and conditionally apply 034 with the repository JDBC driver on Windows:

$jdk = "D:\devtool\jdk\jdk-21\bin"
$driver = "tools\migration\mssql-jdbc-13.4.0.jre11.jar"
& "$jdk\javac.exe" -encoding UTF-8 -cp $driver -d $env:TEMP config\migrations\tools\ApplyModuleRuntimeViews.java
& "$jdk\java.exe" -cp "$env:TEMP;$driver" ApplyModuleRuntimeViews

The tool refuses non-FMS catalogs and executes 034 only when a required runtime view is missing. For a database in the validated intermediate state, run ApplyModuleRuntimeViews --dry-run-cutover first. After verifying a database backup, ApplyModuleRuntimeViews --apply-cutover executes 033, then conditionally executes 034 and verifies all required runtime views.