mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
refactor: Move Prisma schema to /dbal/shared (source of truth)
The Prisma schema is the single source of truth for the entire system and should live in shared, not in development-specific location. MOVED: - /dbal/development/prisma/schema.prisma → /dbal/shared/prisma/schema.prisma UPDATED: - DBAL package.json: db:* scripts reference ../shared/prisma/schema.prisma - config package.json: schema reference updated - gen_prisma_schema.js: outputs to shared location STRUCTURE NOW: - /dbal/shared/prisma/ - Prisma schema (source of truth) - /dbal/shared/seeds/ - Seed data (YAML files) - /dbal/development/ - Uses shared schema via relative path This ensures: ✅ Single source of truth for schema ✅ Schema is shared across all implementations (Phase 2 TypeScript, Phase 3 C++) ✅ Development just references the shared schema ✅ Independent deployability maintained Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,8 @@
|
||||
"Bash(npx tsc:*)",
|
||||
"Bash(npm run build:*)",
|
||||
"Bash(npm run codegen:*)",
|
||||
"Bash(npm:*)"
|
||||
"Bash(npm:*)",
|
||||
"Bash(__NEW_LINE_5881b1d201560748__ echo \"\")"
|
||||
]
|
||||
},
|
||||
"spinnerTipsEnabled": false
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
"extract:auto": "cd frontends/nextjs && npm run extract:auto",
|
||||
"extract:all": "cd frontends/nextjs && npm run extract:all",
|
||||
"extract:help": "cd frontends/nextjs && npm run extract:help",
|
||||
"db:generate": "npx prisma generate --schema=../dbal/development/prisma/schema.prisma",
|
||||
"db:migrate": "npx prisma migrate dev --schema=../dbal/development/prisma/schema.prisma"
|
||||
"db:generate": "npx prisma generate --schema=../dbal/shared/prisma/schema.prisma",
|
||||
"db:migrate": "npx prisma migrate dev --schema=../dbal/shared/prisma/schema.prisma"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@prisma/client": "^7.2.0",
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
"codegen": "tsx ../shared/tools/codegen/gen_types.ts",
|
||||
"codegen:prisma": "node ../shared/tools/codegen/gen_prisma_schema.js",
|
||||
"generate-types": "node ../shared/tools/codegen/generate-types.js",
|
||||
"db:generate": "prisma generate --schema=prisma/schema.prisma",
|
||||
"db:push": "prisma db push --schema=prisma/schema.prisma",
|
||||
"db:migrate": "prisma migrate deploy --schema=prisma/schema.prisma",
|
||||
"db:studio": "prisma studio --schema=prisma/schema.prisma",
|
||||
"db:generate": "prisma generate --schema=../shared/prisma/schema.prisma",
|
||||
"db:push": "prisma db push --schema=../shared/prisma/schema.prisma",
|
||||
"db:migrate": "prisma migrate deploy --schema=../shared/prisma/schema.prisma",
|
||||
"db:studio": "prisma studio --schema=../shared/prisma/schema.prisma",
|
||||
"db:seed": "tsx ../shared/seeds/load-and-apply.ts"
|
||||
},
|
||||
"keywords": [
|
||||
|
||||
@@ -165,6 +165,6 @@ const renderModel = (model) => {
|
||||
}
|
||||
|
||||
const schema = [header, models.map(renderModel).join('\n\n')].join('\n\n')
|
||||
const outputPath = path.resolve(__dirname, '../../../development/prisma/schema.prisma')
|
||||
const outputPath = path.resolve(__dirname, '../../prisma/schema.prisma')
|
||||
fs.writeFileSync(outputPath, schema + '\n', 'utf8')
|
||||
console.log(`Prisma schema written to ${outputPath}`)
|
||||
|
||||
Reference in New Issue
Block a user