aboutsummaryrefslogtreecommitdiffstats
path: root/src/seeder/seeding.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/seeder/seeding.service.ts')
-rw-r--r--src/seeder/seeding.service.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/seeder/seeding.service.ts b/src/seeder/seeding.service.ts
new file mode 100644
index 0000000..f145eb5
--- /dev/null
+++ b/src/seeder/seeding.service.ts
@@ -0,0 +1,29 @@
+import { Injectable } from '@nestjs/common';
+import { FilePurpose } from 'src/file/entity/purpose.entity';
+import { EntityManager } from 'typeorm';
+
+@Injectable()
+export class SeedingService {
+ constructor(private readonly entityManager: EntityManager) {}
+
+ async seed(): Promise<void> {
+ await this.entityManager.save(FilePurpose, [
+ {
+ id: 1,
+ name: 'QUESTS_FILE',
+ },
+ {
+ id: 2,
+ name: 'CATEGORIES_FILE',
+ },
+ {
+ id: 3,
+ name: 'ITEMS_FILE',
+ },
+ {
+ id: 4,
+ name: 'MAIN_CONFIGURATION_FILE',
+ },
+ ]);
+ }
+}