Unclassified

Round 2 — Neon Migration 035 Verification

Date: 2026-07-29
Migration: 035_canonical_spine_schema_fortress.sql
Status: Migration exists; live verification needed


Migration Stats

MetricCount
Total lines1,634
Tables created114
Indexes created39
Extensions2 (uuid-ossp, pgcrypto)
Policies (RLS)0 (added in 042)

Key Tables (Customer Zero / External Product)

Identity & Tenancy

  • spine_organizations — organization registry
  • spine_workspaces — workspace registry
  • spine_users — user registry
  • spine_memberships — user↔organization membership
  • spine_roles — role definitions
  • spine_permissions — permission definitions
  • spine_role_bindings — user↔role assignments
  • spine_consent_grants — consent records
  • spine_api_key_refs — API key references

Platform Configuration

  • platform_config_layers — config layer registry
  • platform_compiled_configs — compiled config snapshots
  • platform_feature_flags — feature flag registry
  • platform_entitlements — entitlement definitions
  • platform_activation_runs — activation run records
  • platform_activation_steps — activation step records
  • platform_hydration_plans — hydration plan registry

Connectors & Integrations

  • spine_connector_catalog — connector catalog (65 connectors)
  • spine_connector_versions — connector version registry
  • spine_connector_installations — tenant connector installations
  • integration_connections — active connections
  • integration_connection_health — connection health records
  • integration_provider_schemas — provider schema definitions
  • integration_schema_mappings — schema mapping rules
  • integration_sync_cursors — sync cursor state
  • integration_webhook_endpoints — webhook endpoint registry

Discovery

  • discovery_runs — discovery run records
  • discovery_assets — discovered assets
  • discovery_capability_candidates — capability candidates
  • discovery_domain_manifests — domain manifest records

Spine Core

  • spine_entities — entity registry
  • spine_activities — activity log
  • spine_knowledge_documents — knowledge documents
  • spine_knowledge_topics — knowledge topics
  • spine_memories — memory records
  • spine_lifecycle_definitions — lifecycle definitions
  • spine_lifecycle_transitions — lifecycle transitions
  • spine_proposals — governance proposals
  • spine_evidence — proposal evidence
  • spine_approvals — approval records

Governance

  • governance_proposals — governance proposal registry
  • governance_checkpoints — checkpoint records (D1 in 042)
  • governance_audit_log — audit log

Product

  • product_workbench_overview — workbench overview projection
  • product_workbench_items — workbench item projection
  • product_workbench_metrics — workbench metric projection

Verification Queries

Run these against the live Neon database to verify migration 035 is applied:

-- 1. Check extension
SELECT extname FROM pg_extension WHERE extname IN ('uuid-ossp', 'pgcrypto');

-- 2. Check critical tables exist
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name IN (
  'spine_organizations', 'spine_workspaces', 'spine_users',
  'spine_memberships', 'spine_connector_catalog',
  'spine_connector_installations', 'spine_entities',
  'spine_activities', 'spine_proposals', 'governance_proposals',
  'product_workbench_overview'
)
ORDER BY table_name;

-- 3. Check indexes
SELECT indexname FROM pg_indexes
WHERE schemaname = 'public'
AND tablename LIKE 'spine_%'
ORDER BY indexname
LIMIT 20;

-- 4. Check table counts
SELECT
  (SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public') as total_tables,
  (SELECT count(*) FROM pg_indexes WHERE schemaname = 'public') as total_indexes;

-- 5. Check RLS policies (should be 0 in 035, added in 042)
SELECT policyname FROM pg_policies WHERE schemaname = 'public' LIMIT 5;

Expected Results

CheckExpected
Extensionsuuid-ossp, pgcrypto present
Critical tablesAll 11 tables listed above exist
Table count≥ 114
Index count≥ 39
RLS policies0 (added in migration 042)

If Migration 035 Is Not Applied

# Apply migration 035 to Neon
psql "$FORTRESS_DATABASE_URL" -f migrations/035_canonical_spine_schema_fortress.sql

# Verify after application
psql "$FORTRESS_DATABASE_URL" -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public';"

Customer Zero Specific

Customer Zero uses the same tables but with tenant_id = 'iw-customer-zero' on all tenant-owned rows. After migration 035 is verified:

-- Check Customer Zero data exists
SELECT count(*) FROM spine_connector_installations WHERE tenant_id = 'iw-customer-zero';
SELECT count(*) FROM spine_entities WHERE tenant_id = 'iw-customer-zero';