We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0bd654 commit 93070ddCopy full SHA for 93070dd
1 file changed
backend/src/scripts/seed-chapters.ts
@@ -9,10 +9,18 @@ import { ChapterEntity } from '../infrastructure/db/chapter.entities';
9
async function main() {
10
console.log('[Seed] Connecting to database...');
11
12
- const dataSource = new DataSource(makeTypeOrmOptions() as any);
+ const opts = makeTypeOrmOptions();
13
+
14
+ // Create DataSource with synchronize to create tables if they don't exist
15
+ const dataSource = new DataSource({
16
+ ...opts,
17
+ synchronize: true,
18
+ logging: false,
19
+ } as any);
20
21
await dataSource.initialize();
22
- console.log('[Seed] Connection established.');
23
+ console.log('[Seed] Connection established and schema synchronized.');
24
25
const chapterRepo = dataSource.getRepository(ChapterEntity);
26
0 commit comments