add drizzle schema and removed astrodb stuff
This commit is contained in:
8
src/db/schema.ts
Normal file
8
src/db/schema.ts
Normal 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
4
src/utils/db.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'dotenv/config';
|
||||
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||
|
||||
const db = drizzle(process.env.DATABASE_URL!);
|
||||
Reference in New Issue
Block a user