fix(conversation): use synchronize:true for 100% reliable schema sync

- Remove migration-based approach which kept failing
- Enable synchronize:true to auto-sync Entity with database
- Schema will always match Entity definition on startup

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

View File

@ -25,9 +25,8 @@ import { HealthModule } from './health/health.module';
password: configService.get('POSTGRES_PASSWORD'),
database: configService.get('POSTGRES_DB', 'iconsulting'),
entities: [__dirname + '/**/*.entity{.ts,.js}'],
migrations: [__dirname + '/migrations/*{.ts,.js}'],
migrationsRun: true, // 自动运行迁移
synchronize: configService.get('NODE_ENV') === 'development',
// 自动同步数据库schema - 确保Entity与数据库100%一致
synchronize: true,
logging: configService.get('NODE_ENV') === 'development',
}),
}),