Commit Graph

5 Commits

Author SHA1 Message Date
cawcenter
bbf2127f5d 🚀 STABILITY PATCH v1.0: Added 13 missing tables to Golden Schema
ANALYTICS ENGINE (4 tables):
- site_analytics: GA/Ads/Pixel tracking config
- events: Custom event tracking
- pageviews: Page view analytics
- conversions: Conversion tracking with lead linking

GEO-INTELLIGENCE (3 tables):
- locations_states: 50 US states with codes
- locations_counties: 3,143 counties
- locations_cities: Cities with lat/long, zip codes

LEAD CAPTURE (2 tables):
- forms: Dynamic form builder
- form_submissions: Form data storage

SITE BUILDER (3 tables):
- navigation: Self-referential menu system
- globals: Site-wide settings (singleton per site)
- hub_pages: Hierarchical content hubs

SYSTEM (1 table):
- work_log: Activity logging

Also added Directus UI configs for all new FK fields.

Schema now has 28 tables matching TypeScript types.
2025-12-14 14:32:23 -05:00
cawcenter
a74a4e946d Refactor Directus types: rename to schemas.ts, fix imports, and resolve type errors 2025-12-14 12:48:08 -05:00
cawcenter
99f406e998 schema: implement Golden Schema with Harris Matrix ordering + Directus UI config
- Batch 1 (Foundation): sites, campaign_masters, 5 independent tables
- Batch 2 (Walls): 7 first-level children
- Batch 3 (Roof): link_targets
- Directus UI: Auto-configure dropdowns for all foreign keys
- Fix template bug: campaign_name → name
- Proper dependency ordering prevents constraint failures
2025-12-14 12:21:17 -05:00
cawcenter
29337e8f42 fix: add missing parent tables and correct field names in schema
CRITICAL FIXES:
- Added 'sites' table (SUPER PARENT) - referenced by 10+ tables
- Added 'campaign_masters' table - referenced by 3 tables
- Fixed field names: campaign → campaign_id, site → site_id
- Organized schema into dependency batches (Batch 1→2→3)

This fixes the root cause of foreign key constraint failures.
2025-12-14 12:15:06 -05:00
cawcenter
7b95b7251d feat: complete database schema with all 39 tables and foreign key relationships 2025-12-14 10:16:01 -05:00