Initial import of Forge app
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import 'dotenv/config';
|
||||
import { pool, initDB, reseedFromArchives } from './db';
|
||||
|
||||
// CLI: reload the tickets table from server/data/*.json, replacing whatever is
|
||||
// there. Use after regenerating the archives (e.g. from a Let it Snow storage
|
||||
// dump via scripts/dump-to-archives.mjs). Destructive: TRUNCATEs tickets first.
|
||||
// npx tsx server/reseed.ts (or: npm run reseed)
|
||||
(async () => {
|
||||
if (!process.env.DATABASE_URL) {
|
||||
console.error('DATABASE_URL is required');
|
||||
process.exit(1);
|
||||
}
|
||||
await initDB();
|
||||
const n = await reseedFromArchives();
|
||||
console.log(`Reseeded ${n} tickets from server/data archives`);
|
||||
await pool.end();
|
||||
})();
|
||||
Reference in New Issue
Block a user