apps/web-app/prisma/schema.prisma
is the ONLY source of truth for database schema
- NEVER modify Python models in backend directly
- ALWAYS update schema in Prisma first, then regenerate Python models
- Make changes to
apps/web-app/prisma/schema.prisma
- Run:
uv run python scripts/prisma_to_python.py apps/web-app/prisma/schema.prisma
- Review generated files in
apps/web-app/prisma/generated/
- Copy generated files to backend project
apps/web-app/prisma/generated/models.py
- SQLAlchemy models
apps/web-app/prisma/generated/schemas.py
- Pydantic schemas
- Any files in backend derived from these generators
- Regenerate models:
uv run python scripts/prisma_to_python.py apps/web-app/prisma/schema.prisma