Files
lincodex/.agents/standards/database.md
T
2026-10-05 14:23:31 +03:00

956 B

Database standard

PostgreSQL is the planned system of record for product data and future background jobs. The current schema contains only what the technical scaffold needs.

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.