From aeb8b66375335e8c9d6cb9cb0d8d7da3d8b79628 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Fri, 15 Mar 2024 20:23:41 +0000 Subject: Initial commit --- src/seeder/seeding.service.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/seeder/seeding.service.ts (limited to 'src/seeder') 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 { + 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', + }, + ]); + } +} -- cgit v1.2.3-70-g09d2