Schema lives in a single file: database/schema.sql
Uses plain PostgreSQL SQL only — no PL/pgSQL functions or triggers. updated_at is set by the Node.js backend.
Seed data: database/seed.sql
npm run db:migrate # apply schema
npm run db:seed # seed data + admin user
npm run db:setup # bothAdmin credentials come from ADMIN_EMAIL and ADMIN_PASSWORD in .env.
users,user_profilesidentity_verifications,verification_documents(metadata only)categories(self-referential tree)products,product_imagesfavorites,offersconversations,conversation_participants,messagesorders,order_status_historydelivery_zones,delivery_rates,delivery_rulesreviews,reports,notifications,audit_logs
- UUIDs for user-facing entity IDs
NUMERIC(12,2)for money (NPR)TIMESTAMPTZfor all timestamps- Status fields enforced with CHECK constraints
- Foreign keys with explicit ON DELETE behavior
Full column-level specification is in the Phase 0 architecture document.