mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove seed fragments form helpers
This commit is contained in:
parent
6db9586fb8
commit
085e8e7e82
@ -1,6 +1,5 @@
|
||||
import CONFIG from './config'
|
||||
import { createPool, PoolConfig } from 'mysql'
|
||||
import { useSeeding, runSeeder } from 'typeorm-seeding'
|
||||
import { Migration } from 'ts-mysql-migrate'
|
||||
import path from 'path'
|
||||
|
||||
@ -32,17 +31,4 @@ const resetDB = async (closePool = false): Promise<void> => {
|
||||
if (closePool) pool.end()
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
const runSeeds = async (seeds: any[]): Promise<void> => {
|
||||
if (seeds.length > 0) {
|
||||
await useSeeding({
|
||||
root: process.cwd(),
|
||||
configName: 'ormconfig.js',
|
||||
})
|
||||
for (let i = 0; i < seeds.length; i++) {
|
||||
await runSeeder(seeds[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { resetDB, pool, migration, initialize, runSeeds }
|
||||
export { resetDB, pool, migration, initialize }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user