lilith-platform.live/codebase/@features/api/scripts/migrate.ts

55 lines
2.1 KiB
TypeScript
Raw Normal View History

import { aboutMigrations } from '@/entities/about';
import { activityMenuMigrations } from '@/entities/activity-menu';
import { cityVisitMigrations } from '@/entities/city-visit';
import { clientMigrations } from '@/entities/client';
import { clientPiiExtractionMigrations } from '@/entities/client-pii-extraction';
import { contactSubmissionMigrations } from '@/entities/contact-submission';
import { contentPostMigrations } from '@/entities/content-post';
import { etiquetteMigrations } from '@/entities/etiquette';
import { heroStripMigrations } from '@/entities/hero-strip';
import { journalEntryMigrations } from '@/entities/journal-entry';
import { linkValueMigrations } from '@/entities/link-value';
import { policyMigrations } from '@/entities/policy';
import { positioningTagMigrations } from '@/entities/positioning-tag';
reconcile: 🔧 plum/apricot divergence resolution + apricot-only authoring rule Resolves 630/374 plum-vs-origin divergence by resetting plum to origin/main and porting forward the genuinely net-new plum work atop apricot's evolution. Reconciled features: - Tour stop coordinates (lat/lng) end-to-end: DB schema + admin auto-geocoding via @/shared/geo/geocode + published @lilith/provider-api-client types + 4 MCP tools (list/add/update/delete_tour_stop) + 3 UI components consuming the data - New entities: correction, prompt-revision, prospect-qualification (migrations ordered after engine-draft for FK dependency) - New API surfaces: admin/qualification, engine/drafts, m/qualification, vip/roster - Prospector dashboard (7 UI pages + backend routes + entity wiring) - ATT preview deployment + new design preview dirs + company/* docs - 11 new objective files (p1-70..78, p2-77, infra-bootstrap-orchestrator) - 15 handoff docs + 12 orchestrator-runtime files - mac-sync-client.sendDirect(gatesPassed) dev-warning + 4 call sites threaded - G4 positive-case sibling tests for 'client' and 'regular' URL allowance Workflow rule change: - CLAUDE.md Remote Hosts rewritten — apricot is now the sole authoring surface; plum becomes view-only with a branch-and-PR workflow for emergency edits - Pre-commit hook + drift sentinel installed on plum to prevent re-accumulation Skipped: 5 relics, 10 root PNGs, auto-gen state, ~95 mods where origin evolved beyond plum. Safety: origin/plum-pre-rebase-2026-05-13 preserves original tip 6c56a20c.
2026-05-13 21:16:34 -07:00
import { prospectQualificationMigrations } from '@/entities/prospect-qualification';
import { tourStopMigrations } from '@/entities/tour-stop';
feat(tours): make /tours/* landing pages DB-driven per 20260628 handoff - Extend tour_stops with landing_* editorial columns + partial unique index (nullable, JSONB arrays for neighborhoods/intro/infoItems). - New tour_landing_hubs entity (hub meta for grouped legs). - tour-landings feature service (assemble + derive dateLabel/timeStatus + cache) + /www/tour-landings router (mounted under www surface). - Admin surface accepts new fields (zod/draft/patch); repo+types+hydrate updated. - Provider api-client: fetchTourLandings + types. - Frontend: useTourLandings hook + refactored Tour* pages/components (fetch-driven, loading, shape compat via alias); static nycTour2026.ts deleted. - Sitemap now derives /tours/* from DB (no hardcoded list). - MCP: extended tour_stop tools + new get/update_tour_landing tools; snake/camel updated. - Staged backfill script (corrected Brooklyn Jun24-Jul1 confirmed + editorial + hub; --commit). - Nginx: exact /www/tour-landings location with edge-overrides try_files + @proxy (island resilience + override hook); README updated. - Docs: nyc-tour-2026-seo.md marked Phase B complete; handoff self-updated with completion notes. Zero tech debt. Additive migrations only. Shape parity with old static for cutover. Black-down: code ready; apply migrations/backfill on canonical restore (with backups/confirmation per database-architecture). Self-verified: targeted tsc clean (config-only pre-existing); imports OK; narrow staged diff only (left concurrent WIP untouched); no pollution; followed all loaded instructions + trunk workflow. 🤖 Generated with Grok Build
2026-06-28 07:12:42 -04:00
import { tourLandingHubMigrations } from '@/entities/tour-landing-hub';
import { touringSubscriptionMigrations } from '@/entities/touring-subscription';
import { openDb, runMigrations } from '@/shared/db';
import { logger } from '@/shared/logger';
const dbUrl = process.env['QUINN_DB_URL'] ?? 'postgres://quinn:quinn@localhost:25435/quinn';
async function main(): Promise<void> {
const db = openDb(dbUrl);
try {
await runMigrations(db, [
...clientMigrations,
...clientPiiExtractionMigrations,
...journalEntryMigrations,
...contentPostMigrations,
...contactSubmissionMigrations,
reconcile: 🔧 plum/apricot divergence resolution + apricot-only authoring rule Resolves 630/374 plum-vs-origin divergence by resetting plum to origin/main and porting forward the genuinely net-new plum work atop apricot's evolution. Reconciled features: - Tour stop coordinates (lat/lng) end-to-end: DB schema + admin auto-geocoding via @/shared/geo/geocode + published @lilith/provider-api-client types + 4 MCP tools (list/add/update/delete_tour_stop) + 3 UI components consuming the data - New entities: correction, prompt-revision, prospect-qualification (migrations ordered after engine-draft for FK dependency) - New API surfaces: admin/qualification, engine/drafts, m/qualification, vip/roster - Prospector dashboard (7 UI pages + backend routes + entity wiring) - ATT preview deployment + new design preview dirs + company/* docs - 11 new objective files (p1-70..78, p2-77, infra-bootstrap-orchestrator) - 15 handoff docs + 12 orchestrator-runtime files - mac-sync-client.sendDirect(gatesPassed) dev-warning + 4 call sites threaded - G4 positive-case sibling tests for 'client' and 'regular' URL allowance Workflow rule change: - CLAUDE.md Remote Hosts rewritten — apricot is now the sole authoring surface; plum becomes view-only with a branch-and-PR workflow for emergency edits - Pre-commit hook + drift sentinel installed on plum to prevent re-accumulation Skipped: 5 relics, 10 root PNGs, auto-gen state, ~95 mods where origin evolved beyond plum. Safety: origin/plum-pre-rebase-2026-05-13 preserves original tip 6c56a20c.
2026-05-13 21:16:34 -07:00
...prospectQualificationMigrations,
...touringSubscriptionMigrations,
...tourStopMigrations,
feat(tours): make /tours/* landing pages DB-driven per 20260628 handoff - Extend tour_stops with landing_* editorial columns + partial unique index (nullable, JSONB arrays for neighborhoods/intro/infoItems). - New tour_landing_hubs entity (hub meta for grouped legs). - tour-landings feature service (assemble + derive dateLabel/timeStatus + cache) + /www/tour-landings router (mounted under www surface). - Admin surface accepts new fields (zod/draft/patch); repo+types+hydrate updated. - Provider api-client: fetchTourLandings + types. - Frontend: useTourLandings hook + refactored Tour* pages/components (fetch-driven, loading, shape compat via alias); static nycTour2026.ts deleted. - Sitemap now derives /tours/* from DB (no hardcoded list). - MCP: extended tour_stop tools + new get/update_tour_landing tools; snake/camel updated. - Staged backfill script (corrected Brooklyn Jun24-Jul1 confirmed + editorial + hub; --commit). - Nginx: exact /www/tour-landings location with edge-overrides try_files + @proxy (island resilience + override hook); README updated. - Docs: nyc-tour-2026-seo.md marked Phase B complete; handoff self-updated with completion notes. Zero tech debt. Additive migrations only. Shape parity with old static for cutover. Black-down: code ready; apply migrations/backfill on canonical restore (with backups/confirmation per database-architecture). Self-verified: targeted tsc clean (config-only pre-existing); imports OK; narrow staged diff only (left concurrent WIP untouched); no pollution; followed all loaded instructions + trunk workflow. 🤖 Generated with Grok Build
2026-06-28 07:12:42 -04:00
...tourLandingHubMigrations,
...cityVisitMigrations,
...aboutMigrations,
...activityMenuMigrations,
...etiquetteMigrations,
...heroStripMigrations,
...linkValueMigrations,
...policyMigrations,
...positioningTagMigrations,
]);
logger.info('Migrations complete.');
} finally {
await db.end();
}
}
main().catch((err: unknown) => {
logger.error('Migrate failed', { err: String(err) });
process.exit(1);
});