Skip to content

feat(dashboard): backfill schema_migrations#1913

Merged
leandrocp merged 1 commit into
mainfrom
feat-lp-backfill-migrations
May 26, 2026
Merged

feat(dashboard): backfill schema_migrations#1913
leandrocp merged 1 commit into
mainfrom
feat-lp-backfill-migrations

Conversation

@leandrocp

Copy link
Copy Markdown
Contributor

This is a small addition to Tenant Migrations page to unblock some tenants that can't run migrations.

I found a tenant stuck at migration 7 with error:

MigrationsFailedToRun: %Postgrex.Error{ postgres: %{ code: :invalid_function_definition, message: "cannot change return type of existing function"....

This error is happening because after applying pgdelta plan the signature of function realtime.apply_rls has changed and that old migration can't call create or replace anymore. Instead of checking and fixing every single statement in every single migration to support this kind of situation, it's better to just backfill schema_migrations and update realtime.migrations_ran because the database is valid and updated, just the metadata is incorrect at that point.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 91.334%feat-lp-backfill-migrations into main. No base build found for main.

@leandrocp
leandrocp merged commit 504d9df into main May 26, 2026
24 checks passed
@leandrocp
leandrocp deleted the feat-lp-backfill-migrations branch May 26, 2026 13:19
@realtime-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.99.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants