11 lines
392 B
JavaScript
11 lines
392 B
JavaScript
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
async function ensureAssetArchiveSchema(pool) {
|
|
const migration = fs.readFileSync(path.join(__dirname, 'asset-archive-schema.sql'), 'utf8');
|
|
// Fail startup if preservation cannot be installed; partial migration rolls back.
|
|
await pool.request().batch(migration);
|
|
}
|
|
|
|
module.exports = { ensureAssetArchiveSchema };
|