Supabase Migration Ledger Reconciliation
Generated 2026-05-28 against project accessible-pdf-converter (vuvwmfxssjosfphzpzim).
Addresses issue #830 steps 1 (ground truth per migration) and 2 (ledger rebuild). Method: snapshot prod object catalog (scripts/snapshot-prod-schema.sql), classify each migration by structural-object presence (scripts/audit-migrations.py), then reconcile ambiguous cases against prod directly (scripts/migration-reconciliation-overlay.json).
Summary
- Total migration files: 139
- Applied in prod: 126
- Not applied (pending β step 3 backlog): 13
Not applied in prod (pending)
These create objects that do not exist in prod. They are the step-3 backlog (apply after idempotency review). Do NOT add them to the ledger.
| Migration | Missing structural objects |
|---|---|
20260325_040_photos_social_features.sql | column:albums.visibility, column:photos.ai_alt_text, column:photos.allow_download, column:photos.exif_data, column:photos.license, column:photos.max_download_resolution, β¦ |
20260325_041_photos_groups.sql | table:group_members, table:group_photos, table:photo_groups |
20260325_042_photos_storage_tiers.sql | column:photo_profiles.storage_tier, table:photo_storage_tiers, view:photo_storage_usage |
20260326_045_forms_tables.sql | table:form_conversions, table:form_fields |
20260410_071_forms_polished_r2_key.sql | column:form_conversions.polished_r2_key |
20260410_072_pptx_remediation_jobs.sql | function:pptx_remediation_jobs_set_completed_at, table:pptx_remediation_jobs |
20260412_079_vpat_parse_cache_sec508.sql | column:vpat_parse_cache.sec508_criteria_data |
20260414_082_admin_notification_preferences.sql | function:update_admin_notification_preferences_updated_at, table:admin_notification_preferences |
20260422_088_account_deletion_audit_status.sql | column:account_deletion_audit.status |
20260422_089_wizard_progress.sql | table:wizard_progress |
20260426_093_user_facing_errors.sql | table:errors |
20260512_104_audit_digest_subscriptions.sql | table:audit_digest_subscriptions |
20260524_123_file_violation_overrides.sql | table:file_violation_override_log, table:file_violation_overrides |
Reconciled (verdict overridden after prod investigation)
| Migration | Script | Final | Evidence |
|---|---|---|---|
20260308_011_drop_uuid_overload_increment_rpc.sql | indeterminate | applied | Legacy ledger records drop_uuid_overload_increment_rpc (20260309212911). Idempotent DROP IF EXISTS. |
20260311_012_update_credit_packages.sql | indeterminate | applied | Legacy ledger records update_credit_packages (20260311220713). Data-only. |
20260322_027_links_product.sql | partial | applied | Applied then renamed: link_items was renamed during the links_v2 consolidation (legacy ledger has links_v2_full + rename_tables_for_links_v2). link_profiles/link_sections now hold this data. Re-running would recreate the obsolete link_items table. |
20260323_029_fix_team_rls.sql | indeterminate | applied | Team RLS policies functioning in prod; legacy ledger has fix_rls_infinite_recursion. Idempotent policy fix. |
20260323_031_linkreach_v2_class_groups.sql | partial | applied | Applied then renamed: link_profiles.department/institution renamed (legacy ledger rename_department_institution). link_class_groups exists in prod. |
20260323_031_links_v2_class_groups.sql | partial | applied | Applied then renamed: class_groups -> link_class_groups, sections -> link_sections, link_items.* columns superseded by links_v2 (legacy ledger links_v2_full + rename_tables_for_links_v2). |
20260323_032_linkreach_analytics.sql | not_applied | applied | Applied then renamed: link_link_clicks -> link_clicks (present in prod). link_class_group_views was later dropped. Re-running would recreate obsolete tables. |
20260327_048_bugflow_tables.sql | partial | applied β οΈ non-idempotent-on-rerun | Applied; bug_tickets/bug_developers/bug_ticket_attachments/bug_ticket_comments present. bug_clarification_requests and bug_fix_attempts were later dropped (feature trimmed). Re-running would resurrect the dropped tables - do NOT re-run blindly. |
20260328_049_disable_always_enhance_formatting.sql | indeterminate | applied | Data-only UPDATE from the pre-drift era (2026-03-28). Idempotent. |
20260403_059_accessible_pdf_export.sql | partial | applied | Applied; 7 accessible_pdf_* columns present on files. accessible_pdf_credit_charged was never kept (credit charging tracked via cost_ledger instead). |
20260407_064_security_advisor_fixes.sql | indeterminate | applied | Proven applied by the audit itself: the permissive policies this migration drops (e.g. βsystem can manage balancesβ, βanyone can submit β¦β) are absent from prod. Legacy ledger has the decomposed drop_always_true_rls_policies / drop_public_insert_policies / pin_function_search_paths entries (20260408). |
20260408_066_drop_tax_certificates_legacy_file_columns.sql | indeterminate | applied | Legacy ledger records drop_tax_certificates_legacy_file_columns (20260408154120). |
20260423_090_app_logs_retention.sql | indeterminate | applied | cron.job βapp_logs_retentionβ exists in prod. |
20260525_125_email_notify_sweep_cron.sql | indeterminate | applied | cron.job βemail-notify-sweepβ exists in prod. |
Applied in prod (full list)
Advisory drift = RLS policies / indexes / triggers the migration created that have since been dropped or renamed (expected; does not affect applied status).
| Migration | Advisory drift |
|---|---|
20250213_001_credits_system.sql | policie:system can manage balances, policie:system can manage transactions |
20250213_002_webhook_events.sql | policie:service can insert webhook events |
20250213_003_contact_submissions.sql | policie:anyone can submit contact form |
20250222_004_multi_tenancy.sql | β |
20260228_005_spend_controls.sql | policie:service role full access spend limits |
20260228_006_cost_ledger.sql | β |
20260302_007_large_conversion_jobs.sql | β |
20260303_008_conversion_predictions.sql | β |
20260308_009_chunk_cost_tracking.sql | β |
20260308_010_fix_increment_rpc_text_id.sql | β |
20260308_011_drop_uuid_overload_increment_rpc.sql | β |
20260311_012_update_credit_packages.sql | β |
20260312_010_chunk_models_used.sql | β |
20260313_013_budget_alerts.sql | policie:service role full access budget alerts |
20260314_014_dollar_budget_limits.sql | β |
20260314_015_files_table.sql | β |
20260316_016_lti_integration.sql | β |
20260319_017_pending_credit_deductions.sql | indexe:idx_pending_deductions_unresolved, policie:service role only |
20260320_018_notifications.sql | β |
20260320_019_formatting_enhancement.sql | β |
20260320_020_webhook_tables.sql | β |
20260320_021_user_preferences.sql | β |
20260321_022_lti_course_scanner.sql | policie:service role full access on lti_course_files |
20260322_023_team_management.sql | policie:system can manage team credit transactions, policie:system can manage team invites, policie:system can manage team members, policie:system can manage teams |
20260322_024_file_checklists.sql | β |
20260322_025_admin_dashboard_expansion.sql | policie:service role full access on admin_audit_log |
20260322_026_fund_team_from_personal.sql | β |
20260322_027_links_product.sql | indexe:idx_link_items_profile, policie:link_items_owner_all, policie:link_items_public_read, trigger:trg_link_items_updated_at |
20260322_028_photos_product.sql | β |
20260323_029_fix_team_rls.sql | β |
20260323_030_team_quota_alerts.sql | β |
20260323_031_linkreach_v2_class_groups.sql | indexe:idx_link_class_groups_profile, indexe:idx_link_section_items_section, indexe:idx_link_sections_group |
20260323_031_links_v2_class_groups.sql | policie:class_groups_owner_all, policie:class_groups_public_read, policie:link_items_owner_all, policie:link_items_public_read, policie:sections_owner_all, policie:sections_public_read, trigger:trg_class_groups_updated_at |
20260323_032_linkreach_analytics.sql | indexe:idx_link_class_group_views_group, indexe:idx_link_link_clicks_link, policie:link_class_group_views_insert, policie:link_class_group_views_owner_read, policie:link_link_clicks_insert, policie:link_link_clicks_owner_read |
20260324_033_auto_create_link_profile.sql | β |
20260324_033_welcome_credits.sql | β |
20260324_034_onboarding_flag.sql | β |
20260324_037_link_templates_v2.sql | β |
20260325_035_enrichment_status.sql | β |
20260325_036_link_templates.sql | β |
20260325_038_link_saved_backgrounds.sql | β |
20260325_039_link_subscriptions.sql | β |
20260326_002_music_scores_lyrics.sql | β |
20260326_043_music_scores.sql | β |
20260326_044_fix_plan_limit_messages.sql | β |
20260327_046_feedback.sql | policie:anyone can submit feedback |
20260327_047_expand_cost_ledger_operation_types.sql | β |
20260327_048_bugflow_tables.sql | indexe:idx_bug_clarification_requests_ticket, indexe:idx_bug_fix_attempts_ticket, indexe:idx_bug_ticket_attachments_ticket, indexe:idx_bug_ticket_comments_ticket, indexe:idx_bug_tickets_created_at, policie:service role full access on bug_clarification_requests, policie:service role full access on bug_developers, policie:service role full access on bug_fix_attempts, policie:service role full access on bug_ticket_attachments, policie:service role full access on bug_ticket_comments, policie:service role full access on bug_tickets |
20260328_049_disable_always_enhance_formatting.sql | β |
20260328_050_new_user_notified.sql | β |
20260328_051_allow_anonymous_bug_reports.sql | β |
20260328_052_cost_ledger_background_generation.sql | β |
20260330_053_normalize_email_case.sql | β |
20260401_054_app_logs.sql | β |
20260401_055_tax_certificates.sql | β |
20260402_056_org_chart_tables.sql | policie:anyone can create template shares, policie:public can log share views, policie:service can manage all org charts, policie:service can manage all outputs, policie:service can manage all people, policie:service can manage all quality metrics, policie:service can manage all relationships, policie:service can manage all versions, policie:service manages all shares, policie:service manages share views, policie:service manages template share views, policie:service manages template shares |
20260402_057_deduct_credits_org_chart.sql | β |
20260402_058_remediation_jobs.sql | β |
20260403_059_accessible_pdf_export.sql | β |
20260403_060_auto_accessible_pdf_preference.sql | β |
20260403_061_vision_alt_text_preference.sql | β |
20260405_062_images_externalized.sql | β |
20260405_063_xhtml_ir.sql | β |
20260407_056_tax_exemption_review.sql | β |
20260407_064_security_advisor_fixes.sql | β |
20260408_065_tax_certificate_documents.sql | β |
20260408_066_drop_tax_certificates_legacy_file_columns.sql | β |
20260408_067_tax_exemption_ai_review.sql | β |
20260409_068_remediation_jobs_vpat.sql | β |
20260409_069_tax_exemption_hardening.sql | β |
20260410_070_fix_deduct_credits_overload.sql | β |
20260411_073_vpat_reports.sql | β |
20260411_074_vpat_parse_cache.sql | β |
20260411_075_vpat_cost_tracking.sql | β |
20260412_076_vpat_source_file_url.sql | policie:users can delete own vpat documents, policie:users can read own vpat documents, policie:users can upload own vpat documents |
20260412_077_audio_transcription_jobs.sql | β |
20260412_078_vpat_sec508_scores.sql | β |
20260412_080_vpat_scoring_profile_snapshot.sql | β |
20260412_081_audio_jobs_caption_columns.sql | β |
20260416_083_files_allow_audio_type.sql | β |
20260419_084_prospect_management.sql | β |
20260421_085_account_deletion_pipeline.sql | constraint:bugflow_submitted_by_fkey |
20260421_086_account_deletion_audit_uniqueness.sql | β |
20260421_087_user_processing_notification_prefs.sql | β |
20260423_090_app_logs_retention.sql | β |
20260425_091_disable_ai_services.sql | β |
20260426_092_schema_drift_catchup.sql | β |
20260429_094_files_styled_output_keys.sql | β |
20260430_095_alt_text_edits.sql | β |
20260505_096_files_accessible_pdf_verapdf.sql | β |
20260507_097_files_error_code.sql | β |
20260508_099_vpat_reports_product_type.sql | β |
20260508_100_human_verification.sql | β |
20260509_101_alt_text_decisions.sql | β |
20260509_102_remediation_jobs_fetch_job_id.sql | β |
20260512_103_audit_cicd_tables.sql | β |
20260512_103_promo_claims.sql | β |
20260514_105_welcome_credits_25.sql | β |
20260514_106_cost_monitor_observations.sql | β |
20260514_106_voice_otp_cost_ledger.sql | β |
20260514_107_link_profile_phone_signup_guard.sql | β |
20260517_108_alt_text_edits_deleted_action.sql | β |
20260517_108_credit_idempotency.sql | β |
20260517_109_html_edits.sql | β |
20260517_110_accessu_2026_auto_promo.sql | β |
20260517_111_s3_integrations.sql | β |
20260517_112_s3_integrations_fix.sql | β |
20260517_113_org_chart_annual_plan.sql | β |
20260518_114_s3_detection_mode_event.sql | β |
20260518_115_s3_event_source_secret.sql | β |
20260518_116_s3_usage_summary_fn.sql | β |
20260518_117_org_chart_per_chart_entitlement.sql | β |
20260518_118_org_chart_finalize_invariants.sql | β |
20260522_119_cost_trickle_alerts.sql | β |
20260522_120_cost_alert_retry.sql | β |
20260523_121_audit_api_keys_tier.sql | β |
20260524_122_hide_aaa_results.sql | β |
20260525_124_email_notify_to_files.sql | β |
20260525_125_email_notify_sweep_cron.sql | β |
20260526_126_normalize_profile_emails.sql | β |
20260526_127_app_logs_email_ip.sql | β |
20260527_128_welcome_credits_10.sql | β |
20260527_129_gcp_budget_events.sql | β |
20260527_130_admin_jobs_unified_view.sql | β |
20260527_131_cost_ledger_check_sync.sql | β |
20260528_132_vendor_balances.sql | β |