feat: Setup Drizzle and create 'users' schema

This commit is contained in:
April Hall 2025-01-03 22:33:39 -05:00
parent 4f5dcf2589
commit 861418db70
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
4 changed files with 10 additions and 7 deletions

View File

@ -1,2 +1,2 @@
# Replace with your DB credentials!
DATABASE_URL="postgres://user:password@host:port/db-name"
DATABASE_URL="postgres://user:password@localhost:5432/svchat"

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ node_modules
.wrangler
/.svelte-kit
/build
/drizzle
# OS
.DS_Store

View File

@ -11,8 +11,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"db:push": "drizzle-kit push",
"db:migrate": "drizzle-kit migrate",
"db:migrate": "drizzle-kit generate --config drizzle.config.ts && drizzle-kit push --config drizzle.config.ts",
"db:studio": "drizzle-kit studio"
},
"devDependencies": {

View File

@ -1,6 +1,9 @@
import { pgTable, serial, text, integer } from 'drizzle-orm/pg-core';
import { pgTable, uuid, text } from 'drizzle-orm/pg-core';
export const user = pgTable('user', {
id: serial('id').primaryKey(),
age: integer('age')
export const users = pgTable('users', {
id: uuid('id').primaryKey(),
username: text('username'),
displayname: text('display_name'),
salt: text('salt'),
hash: text('hash')
});