refactor(backend): simplify media schema and recording metadata
This commit is contained in:
18
Backend/scripts/migrate.ts
Normal file
18
Backend/scripts/migrate.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'dotenv/config';
|
||||
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
||||
|
||||
import { db, pool } from '../db/client';
|
||||
|
||||
const run = async (): Promise<void> => {
|
||||
await migrate(db, { migrationsFolder: './drizzle' });
|
||||
await pool.end();
|
||||
console.log('Database migrations applied.');
|
||||
};
|
||||
|
||||
run()
|
||||
.then(() => process.exit(0))
|
||||
.catch(async (error) => {
|
||||
console.error('Failed to apply database migrations', error);
|
||||
await pool.end().catch(() => undefined);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user