Spaces:
Sleeping
Sleeping
| import "reflect-metadata"; | |
| import { AppDataSource } from "../utils/dataSource"; | |
| async function runMigrations() { | |
| try { | |
| console.log("Connecting to database..."); | |
| await AppDataSource.initialize(); | |
| console.log("β Database connected"); | |
| console.log("Running migrations..."); | |
| await AppDataSource.runMigrations(); | |
| console.log("β Migrations completed successfully"); | |
| await AppDataSource.destroy(); | |
| process.exit(0); | |
| } catch (error) { | |
| console.error("β Migration failed:", error); | |
| await AppDataSource.destroy(); | |
| process.exit(1); | |
| } | |
| } | |
| runMigrations(); | |