18 lines
378 B
TypeScript
18 lines
378 B
TypeScript
import { connectionConfig, migrate, pool } from "../database";
|
|
import { dropTables, exitIfUnforced } from "./util";
|
|
|
|
async function main(): Promise<void> {
|
|
exitIfUnforced();
|
|
|
|
try {
|
|
await dropTables();
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error("Failed to clear database:", err.message);
|
|
process.exit(1);
|
|
});
|