Feature/migrate seed.js to TypeScript (#4248)

* feat(db): migrate seed.js to typescript

* feat(db): change seed command

* Update changelog
This commit is contained in:
Ken Tandrian 2025-01-28 02:24:30 +07:00 committed by GitHub
parent 657cb510d8
commit eb26707e8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Migrated the database seeding to _TypeScript_
- Upgraded `@trivago/prettier-plugin-sort-imports` from version `4.3.0` to `5.2.1`
- Upgraded `ng-extract-i18n-merge` from version `2.13.1` to `2.14.1`

View File

@ -213,6 +213,6 @@
"node": ">=20"
},
"prisma": {
"seed": "node prisma/seed.js"
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
}
}

View File

@ -1,4 +1,5 @@
const { PrismaClient } = require('@prisma/client');
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {