12 lines
934 B
Markdown
12 lines
934 B
Markdown
# Database standard
|
|
|
|
PostgreSQL is the system of record for product data and durable jobs. Use the migrations and queries to establish the current schema.
|
|
|
|
Put schema changes in ordered backend/db/migrations/ files and queries in backend/db/queries/. sqlc output is derived. Never edit generated SQL models or query code by hand.
|
|
|
|
Keep changes transactional where a business record and its job must commit together. Use constraints for invariants that belong in the database. Review indexes and lock behavior for the real query and migration path.
|
|
|
|
Treat deployed migrations as immutable. Prefer additive, compatible schema changes during rollout. Test migrations against an isolated PostgreSQL instance; do not point tests at a shared or production database.
|
|
|
|
Do not store large resume files in PostgreSQL. Do not give the ML service direct database access. Protect personal data in query results, error messages, logs, and metrics.
|