mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-26 10:44:38 +02:00
refactor(db): consolidate ~20+ databases into 2 (mana_platform + mana_sync)
Mirrors the frontend unification (single IndexedDB) on the backend. All services now use pgSchema() for isolation within one shared database, enabling cross-schema JOINs, simplified ops, and zero DB setup for new apps. - Migrate 7 services from pgTable() to pgSchema(): mana-user (usr), mana-media (media), todo, traces, presi, uload, cards - Update all DATABASE_URLs in .env.development, docker-compose, configs - Rewrite init-db scripts for 2 databases + 12 schemas - Rewrite setup-databases.sh for consolidated architecture - Update shared-drizzle-config default to mana_platform - Update CLAUDE.md with new database architecture docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b1a5c95f1d
commit
3ea28b9065
44 changed files with 311 additions and 346 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { pgTable, uuid, text, varchar, timestamp, jsonb, index, pgEnum } from 'drizzle-orm/pg-core';
|
||||
import { uuid, text, varchar, timestamp, jsonb, index, pgEnum } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import { decks } from './decks.js';
|
||||
import { cardsSchema } from './schema';
|
||||
import { decks } from './decks';
|
||||
|
||||
// AI generation status enum
|
||||
export const aiGenerationStatusEnum = pgEnum('ai_generation_status', [
|
||||
|
|
@ -21,7 +22,7 @@ export interface AIGenerationMetadata {
|
|||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export const aiGenerations = pgTable(
|
||||
export const aiGenerations = cardsSchema.table(
|
||||
'ai_generations',
|
||||
{
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue