fix(conversation): disable synchronize in production

Use init-db.sql for schema management instead of TypeORM auto-sync.
synchronize:true is dangerous in production and causes conflicts
when multiple services share tables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-24 19:41:44 -08:00
parent 6718fdc9e3
commit 2c1edc26af
1 changed files with 2 additions and 2 deletions

View File

@ -25,8 +25,8 @@ import { HealthModule } from './health/health.module';
password: configService.get('POSTGRES_PASSWORD'),
database: configService.get('POSTGRES_DB', 'iconsulting'),
entities: [__dirname + '/**/*.entity{.ts,.js}'],
// 自动同步数据库schema - 确保Entity与数据库100%一致
synchronize: true,
// 生产环境禁用synchronize使用init-db.sql初始化schema
synchronize: false,
logging: configService.get('NODE_ENV') === 'development',
}),
}),