Spaces:
Sleeping
Sleeping
Download backend/scripts/baselineMigrations.mjs from bardd/mike-backend: direct link, hf CLI and curl.
- Browser
- Download file 605 Bytes
-
https://huggingface.co/spaces/bardd/mike-backend/resolve/main/backend/scripts/baselineMigrations.mjs
- Command line
-
hf download hf://spaces/bardd/mike-backend/backend/scripts/baselineMigrations.mjs
-
curl -L -o baselineMigrations.mjs https://huggingface.co/spaces/bardd/mike-backend/resolve/main/backend/scripts/baselineMigrations.mjs
605 Bytes
| import pg from "pg"; | |
| import { baselineDatabase } from "./migrationLib.mjs"; | |
| const databaseUrl = process.env.DATABASE_URL; | |
| if (!databaseUrl) { | |
| console.error("DATABASE_URL is required"); | |
| process.exit(1); | |
| } | |
| const pool = new pg.Pool({ connectionString: databaseUrl }); | |
| try { | |
| const result = await baselineDatabase(pool); | |
| console.log(`Recorded baseline migrations: ${result.recorded.join(", ")}`); | |
| } catch (error) { | |
| console.error(error instanceof Error ? error.message : error); | |
| process.exitCode = 1; | |
| } finally { | |
| await pool.end(); | |
| } | |
| if (process.exitCode) { | |
| process.exit(process.exitCode); | |
| } | |