{"ok":true,"meta":{"generatedAt":"2026-06-30T13:14:59.031Z"},"data":{"version":"tzv3-database-bootstrap-v1","endpoint":"/api/database/bootstrap-policy","status":{"configured":false,"provider":"static-seed","writable":false},"migrationFiles":["drizzle/0001_initial_tzv3.sql","drizzle/0002_review_author_alias.sql","drizzle/0003_programmatic_seo_pages.sql"],"auditPolicyEndpoint":"/api/database/audit-policy","migrationManifestEndpoint":"/api/database/migration-manifest","seedManifestEndpoint":"/api/database/seed-manifest","seedPayloadEndpoint":"/api/database/seed-payload","requiredTables":["profiles","media_assets","services","reviews","bookings","collections","programmatic_seo_pages","collection_profiles","status_events","admin_audit_logs"],"requiredIndexes":["profiles_slug_idx","profiles_status_idx","profiles_city_idx","profiles_published_idx","media_assets_profile_idx","services_profile_idx","reviews_profile_idx","reviews_published_idx","bookings_profile_idx","bookings_status_idx","collections_slug_idx","programmatic_seo_pages_slug_idx","programmatic_seo_pages_path_idx","programmatic_seo_pages_indexable_idx","status_events_profile_idx","status_events_source_idx"],"seedExpectations":{"profiles":8,"mediaAssets":16,"services":32,"collections":3,"links":12,"programmaticSeoPages":27},"auditCommand":"npm run database:audit","bootstrapSteps":[{"id":"create-postgres","label":"Create managed PostgreSQL database","owner":"operator","expectedEvidence":"Supabase or Neon project exists in the production region."},{"id":"apply-migrations","label":"Apply TZV3 SQL migrations in order","owner":"operator","command":"psql \"$DATABASE_URL\" -f drizzle/0001_initial_tzv3.sql && psql \"$DATABASE_URL\" -f drizzle/0002_review_author_alias.sql && psql \"$DATABASE_URL\" -f drizzle/0003_programmatic_seo_pages.sql","expectedEvidence":"Migration manifest hashes are recorded, then all required tables and indexes exist before public traffic."},{"id":"configure-env","label":"Configure DATABASE_URL and admin credentials","owner":"operator","command":"npm run env:check:production","expectedEvidence":"Production env check passes without placeholders."},{"id":"import-static-seed","label":"Import verified static seed into PostgreSQL","owner":"admin-api","endpoint":"POST /api/admin/seed","expectedEvidence":"8 profiles, 16 media assets, 32 services, 3 collections, 12 collection links, and 27 programmatic SEO pages are imported."}],"runtimeChecks":[{"id":"migration-manifest","label":"Confirm local migration files and hashes","owner":"system","endpoint":"GET /api/database/migration-manifest","expectedEvidence":"All required SQL migration files are present with sha256 hashes before applying them to production."},{"id":"seed-manifest","label":"Confirm static seed baseline and hashes","owner":"system","endpoint":"GET /api/database/seed-manifest","expectedEvidence":"Static seed baseline reports expected profile, media, service, collection, link, and programmatic SEO counts with sha256 hashes before import."},{"id":"seed-payload","label":"Confirm no-write static seed payload export","owner":"system","endpoint":"GET /api/database/seed-payload","command":"npm run database:seed-payload","expectedEvidence":"Exported seed payload counts match /api/database/seed-manifest and the fullSeed sha256 before POST /api/admin/seed."},{"id":"health-source","label":"Confirm catalog reads from database","owner":"system","endpoint":"GET /api/health","expectedEvidence":"catalogData.source is database and databaseConfigured is true."},{"id":"admin-seed-status","label":"Confirm seed endpoint reflects database mode","owner":"admin-api","endpoint":"GET /api/admin/seed","expectedEvidence":"db.provider is postgres and seed expectations match the imported counts."},{"id":"database-audit","label":"Confirm tables, indexes, and seed baseline with read-only SQL","owner":"system","command":"npm run database:audit","expectedEvidence":"Required TZV3 tables and indexes exist, and seed counts meet or exceed the static catalog baseline."},{"id":"readiness-database","label":"Confirm TZV3 production database gate","owner":"system","command":"TZV3_BASE_URL=https://your-domain.example npm run readiness","expectedEvidence":"database production gate passes on the real domain."}],"safetyGates":["Do not publish real reviews until reviews.is_published=true and author_alias are present.","Do not switch production traffic to database mode until seed counts match the static catalog baseline.","Do not store schedule, VIP, analytics, or legal contact data locally unless the matching retention record is approved.","Do not run destructive imports without an operator-visible backup or provider snapshot."],"productionBoundaries":["Local static-seed mode stays available as a fallback for development only.","Managed PostgreSQL must expose backup, restore, and deletion procedures.","Admin writes must use x-admin-token or signed HttpOnly admin session and must create admin_audit_logs rows.","Programmatic SEO URL rules can move into PostgreSQL only after real inventory and noindex rules are preserved."]}}