add drizzle schema and removed astrodb stuff

This commit is contained in:
2026-01-12 18:02:24 +13:00
parent d9ebacacb8
commit 8794bd6aea
7 changed files with 867 additions and 44 deletions

8
src/db/schema.ts Normal file
View File

@@ -0,0 +1,8 @@
import { integer, pgTable, varchar, date, json } from "drizzle-orm/pg-core";
export const usersTable = pgTable("users", {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
data: date().defaultNow(),
location: json(),
content: json(),
});

4
src/utils/db.ts Normal file
View File

@@ -0,0 +1,4 @@
import 'dotenv/config';
import { drizzle } from 'drizzle-orm/node-postgres';
const db = drizzle(process.env.DATABASE_URL!);