18 lines
531 B
TypeScript
18 lines
531 B
TypeScript
import { execSync } from 'child_process';
|
|||
|
|
|
||
|
|
function runMigrations(): void {
|
||
|
|
// eslint-disable-next-line no-console
|
||
|
|
console.log('🔄 Deploying Prisma database migrations...');
|
||
|
|
try {
|
||
|
|
execSync('npx prisma migrate deploy', { stdio: 'inherit' });
|
||
|
|
// eslint-disable-next-line no-console
|
||
|
|
console.log('✅ Migrations applied successfully.');
|
||
|
|
} catch (error) {
|
||
|
|
// eslint-disable-next-line no-console
|
||
|
|
console.error('❌ Error executing database migrations:', error);
|
||
|
|
process.exit(1);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
runMigrations();
|