db: Drizzle schemas on domain Postgres schemas, baseline migration, reorg SQL
- pgSchema tables for auth, money, house, ref, games, cs, animaldex, site, meta (lists excluded via schemaFilter; runtime list tables are managed by meta.*) - drizzle/ baseline matches the reorged DB exactly (catalog diff = 0 on rehearsal) - db/reorg: one-time SQL that moves the flat public schema (rehearsed on a prod copy) - scripts/db-migrate.ts: migrator with --init to record the baseline and a guard against running the baseline on a non-empty, unrecorded database
This commit is contained in:
14
src/lib/server/db/schema/schemas.ts
Normal file
14
src/lib/server/db/schema/schemas.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { pgSchema } from 'drizzle-orm/pg-core';
|
||||
|
||||
// One Postgres schema per domain (see ~/dev/setup/db/PLAN.md). `lists`, `legacy`,
|
||||
// `energy` and `hardware` are deliberately not modelled here: lists are created at
|
||||
// runtime through meta.create_list(), and energy/hardware belong to other tools.
|
||||
export const authSchema = pgSchema('auth');
|
||||
export const moneySchema = pgSchema('money');
|
||||
export const houseSchema = pgSchema('house');
|
||||
export const refSchema = pgSchema('ref');
|
||||
export const gamesSchema = pgSchema('games');
|
||||
export const csSchema = pgSchema('cs');
|
||||
export const animaldexSchema = pgSchema('animaldex');
|
||||
export const siteSchema = pgSchema('site');
|
||||
export const metaSchema = pgSchema('meta');
|
||||
Reference in New Issue
Block a user