Sfoglia il codice sorgente

chore(aidop): assign official migration number to P0-A cleanup | server 1.0.551

rebase 到 origin/master 后给 P0-A 数据纠偏 migration 取正式号。

  WIP-P0A-CLEANUP.sql        -> 1.0.551.sql
  WIP-P0A-CLEANUP.verify.sql -> 1.0.551.verify.sql
  aidop_migration_derived_cleanup_log 的 migration_version 'WIP-P0A' -> '1.0.551'
  csproj 注册 Copy 条目,版本 1.0.550 -> 1.0.551(§二·7:SQL 号与 csproj 版本一致)

取号经过(两次让号):
  1) origin/master 的 1.0.536(API_INBOUND WP-A)与本地 1.0.536(S8 Stage-3 身份桥)
     同号不同内容,rebase 时把本地那份重编为 1.0.539,远端原号不动。
  2) 本批先取 1.0.550,随后与另一实例刚提交的 1.0.550(S8 订单评审耗时菜单退役)
     实时撞号;对方已在共享 master 上,故本批让号顺延为 1.0.551。

契约测试改为按内容锚点(P0A-G1 / uk_po_line_stat)定位脚本而非按文件名,
避免再次重编号时测试失效。

**脚本仍未在任何库执行(MIGRATION NOT EXECUTED)** ——
Stop-Write Gate 未通过,S3 写入方仍在活跃跑批。执行条件与门禁见脚本头部注释。
YY968XX 20 ore fa
parent
commit
792fa006d2

+ 9 - 3
server/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -11,9 +11,9 @@
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <Copyright>Admin.NET</Copyright>
     <Description>Admin.NET 通用权限开发平台</Description>
-    <AssemblyVersion>1.0.550</AssemblyVersion>
-    <FileVersion>1.0.550</FileVersion>
-    <Version>1.0.550</Version>
+    <AssemblyVersion>1.0.551</AssemblyVersion>
+    <FileVersion>1.0.551</FileVersion>
+    <Version>1.0.551</Version>
   </PropertyGroup>
 
   <ItemGroup>
@@ -886,6 +886,12 @@
     <None Update="UpdateScripts\1.0.550.verify.sql">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="UpdateScripts\1.0.551.sql">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="UpdateScripts\1.0.551.verify.sql">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="UpdateScripts\UAT-PLACEHOLDER-MENU-HIDE.ops.sql">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>

+ 12 - 5
server/Admin.NET.Web.Entry/UpdateScripts/WIP-P0A-CLEANUP.sql → server/Admin.NET.Web.Entry/UpdateScripts/1.0.551.sql

@@ -1,8 +1,15 @@
--- WIP-P0A-CLEANUP.sql
+-- 1.0.551.sql
 --   P0-A 数据纠偏:精准清 std 种群 A + 保全 DWD 不可再生历史 + 清空重建 DWD + schema 收口。
 --
---   ⚠️ 占位文件名(CLAUDE.md §二·7):本仓与 origin/master 当前处于分叉状态且 1.0.536~538 已撞号,
---      无法在此刻取正式版本号。提交前 rename 为 1.0.<next>.sql 并注册 csproj Copy 条目。
+--   ⚠️ 本脚本尚未在任何库执行(MIGRATION NOT EXECUTED)。
+--      未执行原因是 Stop-Write Gate 未通过:S3 写入方仍在活跃跑批
+--      (job_s3_mdp_sync_transform 小时级触发,job_smart_ops_kpi_mdp_bootstrap 随启动触发)。
+--      执行前必须先取得真正的停写窗口,并确认 dwd_process_outsource_delivery
+--      的 MAX(calc_time) 与 COUNT(*) 都不再前进。
+--
+--   号段说明(CLAUDE.md §二·7):本文件曾以 WIP-P0A-CLEANUP.sql 占位;
+--      rebase 到 origin/master 解决 1.0.536 撞号后先取 1.0.550,
+--      随后与另一实例的 1.0.550(S8 菜单退役)实时撞号,本批让号顺延为 1.0.551。
 --
 -- ============================================================================
 -- 背景(全部为只读实测结论,证据见本批审计回执)
@@ -145,7 +152,7 @@ CREATE TABLE IF NOT EXISTS `aidop_migration_derived_cleanup_log` (
 
 INSERT INTO `aidop_migration_derived_cleanup_log`
 (`migration_version`,`table_name`,`estimated_rows`,`data_length`,`reason`)
-SELECT 'WIP-P0A','dwd_process_outsource_delivery',IFNULL(TABLE_ROWS,0),IFNULL(DATA_LENGTH,0),
+SELECT '1.0.551','dwd_process_outsource_delivery',IFNULL(TABLE_ROWS,0),IFNULL(DATA_LENGTH,0),
        CONCAT('P0-A:RoutingOpDetail 主数据被误建模为委外交付事实,叠加 uk 含可空 po_no 致 ODKU 永不命中,膨胀至 3269 万行;',
               '真实 PO 子集 ', @preserve_cnt, ' 行已存入 dwd_process_outsource_delivery_keep_p0a 并于 schema 收口后回插;',
               '其余为错误派生数据,零消费者、零 FK、可由 std 重新生成,不做全量备份')
@@ -284,7 +291,7 @@ WHERE `tenant_id` NOT IN (0,1,1300000000001)
 
 SELECT COUNT(*) AS dwd_rows_after_restore FROM `dwd_process_outsource_delivery`;
 SELECT `estimated_rows` AS rows_before_cleanup FROM `aidop_migration_derived_cleanup_log`
-WHERE `migration_version`='WIP-P0A' AND `table_name`='dwd_process_outsource_delivery';
+WHERE `migration_version`='1.0.551' AND `table_name`='dwd_process_outsource_delivery';
 
 -- ===========================================================================
 -- 回滚(注释,非可执行;执行前请确认无消费者)

+ 2 - 2
server/Admin.NET.Web.Entry/UpdateScripts/WIP-P0A-CLEANUP.verify.sql → server/Admin.NET.Web.Entry/UpdateScripts/1.0.551.verify.sql

@@ -1,4 +1,4 @@
--- WIP-P0A-CLEANUP.verify.sql
+-- 1.0.551.verify.sql
 --   P0-A 数据纠偏的执行后校验。返回单列 ok:1 = 全部断言通过,0 = 任一失败。
 --   提交前随主脚本一并 rename 为 1.0.<next>.verify.sql 并注册 csproj Copy 条目。
 --
@@ -117,7 +117,7 @@ AND (SELECT COUNT(*) FROM `dwd_process_outsource_delivery` WHERE `tenant_id` IN
 -- V9 · 元数据留证已写入,且记录了清理前的量级
 AND (
       SELECT COUNT(*) FROM `aidop_migration_derived_cleanup_log`
-      WHERE `migration_version`='WIP-P0A' AND `table_name`='dwd_process_outsource_delivery'
+      WHERE `migration_version`='1.0.551' AND `table_name`='dwd_process_outsource_delivery'
         AND `estimated_rows` > 1000000
     ) = 1
 

+ 5 - 6
server/Plugins/Admin.NET.Plugin.AiDOP.Tests/DataPlatform/P0aCleanupMigrationContractTests.cs

@@ -34,21 +34,20 @@ public class P0aCleanupMigrationContractTests
     private static string Migration()
     {
         var dir = ScriptsDir();
-        var f = Directory.GetFiles(dir, "WIP-P0A-CLEANUP.sql").FirstOrDefault()
-             ?? Directory.GetFiles(dir, "*.sql")
+        // 按内容锚点而非文件名定位:号段会随 rebase / 撞号重编而变,内容不会。
+        var f = Directory.GetFiles(dir, "*.sql")
                     .FirstOrDefault(p => !p.EndsWith(".verify.sql", Ord)
                                       && File.ReadAllText(p).Contains("P0A-G1", Ord));
-        Assert.True(f != null, "找不到 P0-A cleanup migration(占位名 WIP-P0A-CLEANUP.sql 或已 rename 的正式号)");
+        Assert.True(f != null, "找不到 P0-A cleanup migration(按 P0A-G1 门禁标识定位)");
         return File.ReadAllText(f!);
     }
 
     private static string Verify()
     {
         var dir = ScriptsDir();
-        var f = Directory.GetFiles(dir, "WIP-P0A-CLEANUP.verify.sql").FirstOrDefault()
-             ?? Directory.GetFiles(dir, "*.verify.sql")
+        var f = Directory.GetFiles(dir, "*.verify.sql")
                     .FirstOrDefault(p => File.ReadAllText(p).Contains("uk_po_line_stat", Ord));
-        Assert.True(f != null, "找不到 P0-A cleanup 的 verify 脚本");
+        Assert.True(f != null, "找不到 P0-A cleanup 的 verify 脚本(按 uk_po_line_stat 定位)");
         return File.ReadAllText(f!);
     }