fix(conversation): enable auto-migration on app startup

- Add migrations path to TypeORM config
- Set migrationsRun: true to run pending migrations on startup
- This ensures V2 columns are created automatically when app starts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-24 08:12:50 -08:00
parent b70035ad2f
commit fc6078e4f8
1 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,8 @@ import { HealthModule } from './health/health.module';
password: configService.get('POSTGRES_PASSWORD'), password: configService.get('POSTGRES_PASSWORD'),
database: configService.get('POSTGRES_DB', 'iconsulting'), database: configService.get('POSTGRES_DB', 'iconsulting'),
entities: [__dirname + '/**/*.entity{.ts,.js}'], entities: [__dirname + '/**/*.entity{.ts,.js}'],
migrations: [__dirname + '/migrations/*{.ts,.js}'],
migrationsRun: true, // 自动运行迁移
synchronize: configService.get('NODE_ENV') === 'development', synchronize: configService.get('NODE_ENV') === 'development',
logging: configService.get('NODE_ENV') === 'development', logging: configService.get('NODE_ENV') === 'development',
}), }),