feat(16-01): migrate schema to pgTable and add users table with userId columns

- Rewrite schema.ts from sqlite-core to pg-core (pgTable, serial, timestamp, doublePrecision)
- Add users table with id, logtoSub (unique), createdAt
- Add userId FK column to items, categories, threads, setups, apiKeys, oauthTokens
- Add composite unique constraint on categories(userId, name)
- Change settings PK to composite (userId, key)
- Remove global Uncategorized seed from seed.ts (now per-user lazy)
- Generate Drizzle pg migration
This commit is contained in:
2026-04-05 10:32:51 +02:00
parent f7c9f3dc94
commit 91e93a31a5
6 changed files with 1206 additions and 95 deletions

7
drizzle-pg.config.ts Normal file
View File

@@ -0,0 +1,7 @@
import { defineConfig } from "drizzle-kit";
export default defineConfig({
out: "./drizzle-pg",
schema: "./src/db/schema.ts",
dialect: "postgresql",
});