mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
feat: added drizzle for contact management
This commit is contained in:
parent
1a3faf03d5
commit
ba62489715
8 changed files with 762 additions and 18 deletions
6
surfsense_web/app/db/index.ts
Normal file
6
surfsense_web/app/db/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { drizzle } from 'drizzle-orm/postgres-js'
|
||||
import postgres from 'postgres'
|
||||
import * as schema from './schema'
|
||||
|
||||
const client = postgres(process.env.DATABASE_URL!)
|
||||
export const db = drizzle({ client, schema });
|
||||
9
surfsense_web/app/db/schema.ts
Normal file
9
surfsense_web/app/db/schema.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { integer, pgTable, text, varchar } from "drizzle-orm/pg-core";
|
||||
|
||||
export const usersTable = pgTable("users", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity(),
|
||||
name: varchar({ length: 255 }).notNull(),
|
||||
email: varchar({ length: 255 }).notNull().unique(),
|
||||
company: varchar({ length: 255 }).notNull(),
|
||||
message: text().default(''),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue