feat(M02-A): 建立多小程序租户配置模型
This commit is contained in:
@@ -22,13 +22,16 @@ const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../..');
|
||||
const migrationFiles: Record<MigrationDirection, readonly string[]> = {
|
||||
up: [
|
||||
'database/migrations/2026061601_m01b_core_schema.up.sql',
|
||||
'database/migrations/2026061802_m01c_async_tasks.up.sql'
|
||||
'database/migrations/2026061802_m01c_async_tasks.up.sql',
|
||||
'database/migrations/2026061803_m02a_tenant_apps.up.sql'
|
||||
],
|
||||
verify: [
|
||||
'database/migrations/2026061601_m01b_core_schema.verify.sql',
|
||||
'database/migrations/2026061802_m01c_async_tasks.verify.sql'
|
||||
'database/migrations/2026061802_m01c_async_tasks.verify.sql',
|
||||
'database/migrations/2026061803_m02a_tenant_apps.verify.sql'
|
||||
],
|
||||
down: [
|
||||
'database/migrations/2026061803_m02a_tenant_apps.down.sql',
|
||||
'database/migrations/2026061802_m01c_async_tasks.down.sql',
|
||||
'database/migrations/2026061601_m01b_core_schema.down.sql'
|
||||
]
|
||||
@@ -146,7 +149,7 @@ export async function executeMigrationPlan(
|
||||
for (const [index, statement] of plan.statements.entries()) {
|
||||
const [result] = await pool.query(statement);
|
||||
if (plan.direction === 'verify') {
|
||||
const minimumRows = [10, 26, 1, 2, 5, 1][index] ?? 1;
|
||||
const minimumRows = [10, 26, 1, 2, 5, 1, 3, 5, 1][index] ?? 1;
|
||||
if (!Array.isArray(result) || result.length < minimumRows) {
|
||||
throw new Error(
|
||||
`Migration verification statement ${index + 1} returned fewer than ${minimumRows} rows.`
|
||||
|
||||
Reference in New Issue
Block a user