Initial commit of BlackDice ROI toolkit
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'dotenv/config';
|
||||
import fs from 'node:fs';
|
||||
import { pool } from './db.js';
|
||||
|
||||
const sql = fs.readFileSync(new URL('./schema.sql', import.meta.url), 'utf8');
|
||||
|
||||
const statements = sql.split(';').map((s) => s.trim()).filter(Boolean);
|
||||
|
||||
for (const statement of statements) {
|
||||
await pool.query(statement);
|
||||
console.log('Ran:', statement.split('\n')[0], '...');
|
||||
}
|
||||
|
||||
console.log('Migration complete.');
|
||||
await pool.end();
|
||||
Reference in New Issue
Block a user