24 lines
684 B
JavaScript
24 lines
684 B
JavaScript
"use strict";
|
|
/**
|
|
* Standalone database migration CLI.
|
|
* Applies schema.sql once and exits; run via npm script from the backend package.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require("dotenv/config");
|
|
const connection_1 = require("./connection");
|
|
/**
|
|
* Runs schema migrations and exits with code 0 on success or 1 on failure.
|
|
*/
|
|
async function migrate() {
|
|
try {
|
|
await (0, connection_1.runMigrations)();
|
|
console.log('Migrations completed successfully.');
|
|
process.exit(0);
|
|
}
|
|
catch (err) {
|
|
console.error('Migration failed:', err);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
migrate();
|
|
//# sourceMappingURL=migrate.js.map
|