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:
parent
6718fdc9e3
commit
2c1edc26af
|
|
@ -25,8 +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}'],
|
||||||
// 自动同步数据库schema - 确保Entity与数据库100%一致
|
// 生产环境禁用synchronize,使用init-db.sql初始化schema
|
||||||
synchronize: true,
|
synchronize: false,
|
||||||
logging: configService.get('NODE_ENV') === 'development',
|
logging: configService.get('NODE_ENV') === 'development',
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue