Skip to content

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.

MigrationMissing structural objects
20260325_040_photos_social_features.sqlcolumn: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.sqltable:group_members, table:group_photos, table:photo_groups
20260325_042_photos_storage_tiers.sqlcolumn:photo_profiles.storage_tier, table:photo_storage_tiers, view:photo_storage_usage
20260326_045_forms_tables.sqltable:form_conversions, table:form_fields
20260410_071_forms_polished_r2_key.sqlcolumn:form_conversions.polished_r2_key
20260410_072_pptx_remediation_jobs.sqlfunction:pptx_remediation_jobs_set_completed_at, table:pptx_remediation_jobs
20260412_079_vpat_parse_cache_sec508.sqlcolumn:vpat_parse_cache.sec508_criteria_data
20260414_082_admin_notification_preferences.sqlfunction:update_admin_notification_preferences_updated_at, table:admin_notification_preferences
20260422_088_account_deletion_audit_status.sqlcolumn:account_deletion_audit.status
20260422_089_wizard_progress.sqltable:wizard_progress
20260426_093_user_facing_errors.sqltable:errors
20260512_104_audit_digest_subscriptions.sqltable:audit_digest_subscriptions
20260524_123_file_violation_overrides.sqltable:file_violation_override_log, table:file_violation_overrides

Reconciled (verdict overridden after prod investigation)

MigrationScriptFinalEvidence
20260308_011_drop_uuid_overload_increment_rpc.sqlindeterminateappliedLegacy ledger records drop_uuid_overload_increment_rpc (20260309212911). Idempotent DROP IF EXISTS.
20260311_012_update_credit_packages.sqlindeterminateappliedLegacy ledger records update_credit_packages (20260311220713). Data-only.
20260322_027_links_product.sqlpartialappliedApplied 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.sqlindeterminateappliedTeam RLS policies functioning in prod; legacy ledger has fix_rls_infinite_recursion. Idempotent policy fix.
20260323_031_linkreach_v2_class_groups.sqlpartialappliedApplied then renamed: link_profiles.department/institution renamed (legacy ledger rename_department_institution). link_class_groups exists in prod.
20260323_031_links_v2_class_groups.sqlpartialappliedApplied 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.sqlnot_appliedappliedApplied 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.sqlpartialapplied ⚠️ non-idempotent-on-rerunApplied; 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.sqlindeterminateappliedData-only UPDATE from the pre-drift era (2026-03-28). Idempotent.
20260403_059_accessible_pdf_export.sqlpartialappliedApplied; 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.sqlindeterminateappliedProven 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.sqlindeterminateappliedLegacy ledger records drop_tax_certificates_legacy_file_columns (20260408154120).
20260423_090_app_logs_retention.sqlindeterminateappliedcron.job β€˜app_logs_retention’ exists in prod.
20260525_125_email_notify_sweep_cron.sqlindeterminateappliedcron.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).

MigrationAdvisory drift
20250213_001_credits_system.sqlpolicie:system can manage balances, policie:system can manage transactions
20250213_002_webhook_events.sqlpolicie:service can insert webhook events
20250213_003_contact_submissions.sqlpolicie:anyone can submit contact form
20250222_004_multi_tenancy.sqlβ€”
20260228_005_spend_controls.sqlpolicie: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.sqlpolicie: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.sqlindexe: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.sqlpolicie:service role full access on lti_course_files
20260322_023_team_management.sqlpolicie: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.sqlpolicie:service role full access on admin_audit_log
20260322_026_fund_team_from_personal.sqlβ€”
20260322_027_links_product.sqlindexe: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.sqlindexe:idx_link_class_groups_profile, indexe:idx_link_section_items_section, indexe:idx_link_sections_group
20260323_031_links_v2_class_groups.sqlpolicie: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.sqlindexe: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.sqlpolicie:anyone can submit feedback
20260327_047_expand_cost_ledger_operation_types.sqlβ€”
20260327_048_bugflow_tables.sqlindexe: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.sqlpolicie: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.sqlpolicie: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.sqlconstraint: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β€”