new things
This commit is contained in:
@@ -4,6 +4,7 @@ import postgres from 'postgres';
|
||||
import * as dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import fs from 'fs/promises';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
@@ -25,6 +26,10 @@ const runMigrations = async () => {
|
||||
console.log('Running database migrations...');
|
||||
try {
|
||||
const folder = path.join(__dirname, '../drizzle');
|
||||
// print all migrations
|
||||
const migrations = await fs.readdir(folder);
|
||||
console.log('Migrations:', JSON.stringify(migrations));
|
||||
|
||||
await migrate(db, { migrationsFolder: folder });
|
||||
console.log('Migrations completed successfully.');
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user