test(M01-B): 验证脱敏旧库迁移兼容

This commit is contained in:
Codex
2026-06-18 10:06:26 +08:00
parent 5117ae27d6
commit 1192dcb6b2
13 changed files with 5512 additions and 41 deletions
+12
View File
@@ -11,6 +11,7 @@ const upSql = read('database/migrations/2026061601_m01b_core_schema.up.sql');
const downSql = read('database/migrations/2026061601_m01b_core_schema.down.sql');
const verifySql = read('database/migrations/2026061601_m01b_core_schema.verify.sql');
const seedSql = read('database/seeds/2026061601_m01b_minimal_seed.sql');
const legacyFixtureSql = read('database/fixtures/2026061801_m01b_legacy_schema.sql');
const coreTables = [
'qipai_schema_migrations',
@@ -60,5 +61,16 @@ assert.match(upSql, /legacy_store_id/);
assert.match(upSql, /legacy_order_id/);
assert.match(seedSql, /INSERT IGNORE INTO qipai_legacy_table_mappings/);
assert.match(seedSql, /member_order_info/);
for (const table of [
'member_store_info',
'member_room_info',
'member_order_info',
'member_device_info'
]) {
assert.match(legacyFixtureSql, new RegExp(`CREATE TABLE ${table}`));
}
assert.match(legacyFixtureSql, /DECIMAL\(10,\s*2\)/);
assert.match(legacyFixtureSql, /LEGACY-SANITIZED-001/);
assert.doesNotMatch(legacyFixtureSql, /(?:https?:\/\/|@|password|secret|token)/i);
console.log('PASS: M01-B migration contract is present.');