Compare commits

..

3 Commits

Author SHA1 Message Date
3127a07612 add hero schema 2026-06-14 18:07:35 +02:00
545a8d7273 create player schema 2026-06-14 17:45:54 +02:00
cac033588e install drizzle 2026-06-14 17:42:48 +02:00
6 changed files with 608 additions and 24 deletions

12
drizzle.config.ts Normal file
View File

@@ -0,0 +1,12 @@
import 'dotenv/config';
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
out: './drizzle',
schema: './server/db/',
schemaFilter: ['dnd'],
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});

View File

@@ -16,13 +16,17 @@
"@nuxtjs/supabase": "2.0.9",
"@nuxtjs/tailwindcss": "6.14.0",
"@tailwindcss/vite": "^4.3.1",
"dotenv": "^17.4.2",
"drizzle-orm": "1.0.0-beta.22",
"nuxt": "^4.4.8",
"pg": "^8.21.0",
"tailwindcss": "^4.3.1",
"vue": "^3.5.35",
"vue-router": "^5.1.0"
},
"devDependencies": {
"@iconify-json/hugeicons": "^1.2.29",
"drizzle-kit": "1.0.0-beta.22",
"eslint": "^10.5.0",
"eslint-config-prettier": "^10.1.8",
"prettier": "^3.8.4",

599
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

7
server/db/hero.ts Normal file
View File

@@ -0,0 +1,7 @@
import { player } from "./player";
import { dndSchema } from "./schema";
export const hero = dndSchema.table("heros", (t) => ({
id: t.uuid().primaryKey(),
player_id: t.uuid().notNull().references(() => player.id),
}))

7
server/db/player.ts Normal file
View File

@@ -0,0 +1,7 @@
import { dndSchema } from "./schema";
export const player = dndSchema.table("players", (t) => ({
id: t.uuid().primaryKey(),
name: t.varchar().notNull(),
created_at: t.timestamp().defaultNow()
}))

3
server/db/schema.ts Normal file
View File

@@ -0,0 +1,3 @@
import { pgSchema } from "drizzle-orm/pg-core"
export const dndSchema = pgSchema("dnd")