Import source: app/backend/scripts/apply-schema.mjs
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
import { existsSync } from 'node:fs';
|
||||||
|
import { spawnSync } from 'node:child_process';
|
||||||
|
|
||||||
|
const hasMigrations = existsSync(new URL('../prisma/migrations', import.meta.url));
|
||||||
|
const args = hasMigrations
|
||||||
|
? ['prisma', 'migrate', 'deploy']
|
||||||
|
: ['prisma', 'db', 'push', '--skip-generate'];
|
||||||
|
|
||||||
|
const result = spawnSync('npx', args, { stdio: 'inherit', shell: process.platform === 'win32' });
|
||||||
|
process.exit(result.status ?? 1);
|
||||||
Reference in New Issue
Block a user