feat: impl accounts and channels

This commit is contained in:
2026-09-06 18:17:42 +08:00
parent aa9999a940
commit 1ccee1414c
70 changed files with 9879 additions and 31 deletions
+22
View File
@@ -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);
});