✨ feat: impl accounts and channels
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import postgres from "postgres";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config({ path: ".env.local" });
|
||||
|
||||
const sql = postgres(process.env.DATABASE_URL!);
|
||||
|
||||
async function resetAndInit() {
|
||||
console.log("Dropping old tables...");
|
||||
await sql`DROP TABLE IF EXISTS transactions CASCADE`;
|
||||
await sql`DROP TABLE IF EXISTS channels CASCADE`;
|
||||
await sql`DROP TABLE IF EXISTS accounts CASCADE`;
|
||||
await sql`DROP TABLE IF EXISTS user_accounts CASCADE`;
|
||||
await sql`DROP TABLE IF EXISTS users CASCADE`;
|
||||
console.log("Old tables dropped.");
|
||||
await sql.end();
|
||||
}
|
||||
|
||||
resetAndInit().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user