feat: migrate full Prisma schema to Drizzle ORM (29 tables, 28 enums, 25 relations)

- Install drizzle-orm, drizzle-kit, pg, @types/pg in web/
- Create split schema directory with domain files:
  - auth (users, accounts, sessions, deviceTokens)
  - subscription (familyGroups, familyGroupMembers, subscriptions)
  - darkwatch (watchlistItems, exposures)
  - alerts
  - voiceprint (voiceEnrollments, voiceAnalyses, analysisJobs, analysisResults)
  - spamshield (spamFeedback, spamRules)
  - audit (auditLogs, kpiSnapshots)
  - correlation (normalizedAlerts, correlationGroups)
  - reports (securityReports)
  - marketing (waitlistEntries, blogPosts)
  - hometitle (propertyWatchlistItems, propertySnapshots, propertyChanges)
  - removebrokers (infoBrokers, removalRequests, brokerListings)
- Define all 28 PostgreSQL enums via pgEnum()
- Define all indexes, unique constraints, and foreign keys
- Define all 25 relation definitions via relations() helper
- Update drizzle.config.ts for PostgreSQL dialect
- Update db/index.ts for node-postgres connection
- Replace old placeholder schema.ts with barrel re-export
- Add 38 comprehensive schema tests
This commit is contained in:
2026-05-25 15:35:10 -04:00
parent 9dc55517b1
commit bc20aeaeb6
21 changed files with 1780 additions and 23 deletions

View File

@@ -0,0 +1,14 @@
export * from "./enums";
export * from "./auth";
export * from "./subscription";
export * from "./darkwatch";
export * from "./alerts";
export * from "./voiceprint";
export * from "./spamshield";
export * from "./audit";
export * from "./correlation";
export * from "./reports";
export * from "./marketing";
export * from "./hometitle";
export * from "./removebrokers";
export * from "./relations";