-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathseed.ts
More file actions
38 lines (33 loc) · 939 Bytes
/
Copy pathseed.ts
File metadata and controls
38 lines (33 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { PrismaClient } from '@prisma/client'
import { seedCurrencies } from './currency'
import { seedCountries } from './country'
import { seedMerchants } from './merchant'
import { seedProfiles } from './profile'
import { seedAccounts } from './account'
import { seedTransactions } from './transaction'
import { seedSettings } from './settings'
import { seedCardCodes } from './card-code'
import { seedCards } from './card'
const prisma = new PrismaClient()
async function main() {
console.log(`Start seeding ...`)
await seedCurrencies()
await seedCountries()
await seedMerchants()
await seedProfiles()
await seedAccounts()
await seedTransactions()
await seedCards()
await seedCardCodes()
await seedSettings()
console.log(`Seeding finished.`)
}
main()
.then(async () => {
await prisma.$disconnect()
})
.catch(async e => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})