Update paths in sync.sh, master/main.go, and CLAUDE.md to reflect the directory rename. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
602 B
TypeScript
27 lines
602 B
TypeScript
// reset-db.ts
|
|
// Development command to wipe the database and apply all migrations from scratch
|
|
|
|
import { connectionConfig, migrate, pool } from "../database";
|
|
import { dropTables, exitIfUnforced } from "./util";
|
|
|
|
async function main(): Promise<void> {
|
|
exitIfUnforced();
|
|
|
|
try {
|
|
await dropTables();
|
|
|
|
console.log("");
|
|
await migrate();
|
|
|
|
console.log("");
|
|
console.log("Database reset complete.");
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error("Failed to reset database:", err.message);
|
|
process.exit(1);
|
|
});
|