feat: Setup Drizzle and create 'users' schema
This commit is contained in:
parent
4f5dcf2589
commit
861418db70
@ -1,2 +1,2 @@
|
|||||||
# Replace with your DB credentials!
|
# 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
1
.gitignore
vendored
@ -11,6 +11,7 @@ node_modules
|
|||||||
.wrangler
|
.wrangler
|
||||||
/.svelte-kit
|
/.svelte-kit
|
||||||
/build
|
/build
|
||||||
|
/drizzle
|
||||||
|
|
||||||
# OS
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "prettier --check . && eslint .",
|
"lint": "prettier --check . && eslint .",
|
||||||
"db:push": "drizzle-kit push",
|
"db:migrate": "drizzle-kit generate --config drizzle.config.ts && drizzle-kit push --config drizzle.config.ts",
|
||||||
"db:migrate": "drizzle-kit migrate",
|
|
||||||
"db:studio": "drizzle-kit studio"
|
"db:studio": "drizzle-kit studio"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -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', {
|
export const users = pgTable('users', {
|
||||||
id: serial('id').primaryKey(),
|
id: uuid('id').primaryKey(),
|
||||||
age: integer('age')
|
username: text('username'),
|
||||||
|
displayname: text('display_name'),
|
||||||
|
salt: text('salt'),
|
||||||
|
hash: text('hash')
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user