mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Add data migration to npm scripts
This commit is contained in:
parent
5c4f46a41e
commit
a5fde1b6c8
2 changed files with 6 additions and 3 deletions
|
|
@ -20,6 +20,8 @@ const migrations: Migration[] = migrationFiles
|
|||
.map((id) => ({ id, migrationFn: require(path.join(dataMigrationsPath, id)).default }))
|
||||
.filter((migration) => migration.migrationFn !== undefined)
|
||||
|
||||
if (migrations.length === 0) console.log('No data migrations to run.')
|
||||
|
||||
for (const { id, migrationFn } of migrations) {
|
||||
const startDate = new Date()
|
||||
const migration = await prismaClient.migration.findFirst({ where: { id } })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue