merge: 合并 dev_match 寄卖匹配看板改造到 dev
# Conflicts: # apps/backend/src/services/worker-platform/consignment-matching.integration.test.ts
This commit is contained in:
@@ -64,6 +64,13 @@ export async function runDatabaseMigrations() {
|
||||
|
||||
console.info(`[db:migrate] 迁移目录: ${MIGRATIONS_DIR}`)
|
||||
|
||||
// 分支联调库可能已应用过 main 的 147-158,而本分支的寄卖迁移编号是 147-152;
|
||||
// node-pg-migrate 的 checkOrder 会按名称逐位比较并直接抛错,导致服务起不来。
|
||||
// 生产保持严格顺序;开发/测试允许顺序放宽(迁移文件本身仍需幂等)。
|
||||
const strictMigrationOrder =
|
||||
String(process.env.DB_MIGRATION_STRICT_ORDER || '').trim() === '1' ||
|
||||
String(process.env.NODE_ENV || '').trim() === 'production'
|
||||
|
||||
await runner({
|
||||
databaseUrl: createMigrationDatabaseConfig(),
|
||||
dir: MIGRATIONS_DIR,
|
||||
@@ -72,7 +79,7 @@ export async function runDatabaseMigrations() {
|
||||
migrationsSchema: 'public',
|
||||
schema: 'public',
|
||||
singleTransaction: true,
|
||||
checkOrder: true,
|
||||
checkOrder: strictMigrationOrder,
|
||||
logger: {
|
||||
debug: () => undefined,
|
||||
info: (message) => {
|
||||
|
||||
Reference in New Issue
Block a user