Skip to content

chore(test): catch migrations that run against the wrong schema when several event stores share a database - #56

Merged
yordis merged 1 commit into
yordis/test-scope-zombie-lock-countfrom
yordis/test-migrate-custom-schema
Oct 26, 2026
Merged

yordis merged 1 commit into
yordis/test-scope-zombie-lock-countfrom
yordis/test-migrate-custom-schema

Conversation

@yordis

@yordis yordis commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

@cursor

cursor Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only change; no production migration or runtime behavior is modified.

Overview
Adds regression coverage for multi-schema PostgreSQL setups where more than one Event Store shares a single database.

The new test in migrate_event_store_test.exs renames public to example, creates a fresh public schema with a newly initialized store, snapshots public’s schema_migrations, then runs migration against example only. It expects example to reach 1.5.0 (including subscriptions.lock_generation) while public’s migration history stays identical—the failure mode called out from review of #27.

Supporting helpers (with_conn, migration_history, latest_version, has_lock_generation?) query information_schema and per-schema schema_migrations so assertions stay schema-scoped.

Reviewed by Cursor Bugbot for commit 5727f9a. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e69871f-d990-4c7a-8282-8b906d27b8d2
Commits

Reviewing files that changed from the base of the PR and between a16bcb4 and 6a43262.

Files selected for processing: 1
  • test/migrate_event_store_test.exs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yordis
yordis added this pull request to stack #73 October 26, 2026 16:00
@yordis
yordis force-pushed the yordis/test-migrate-custom-schema branch from 7225aa8 to de8d4cb Compare October 26, 2026 16:16
@yordis
yordis removed this pull request from stack #73 October 26, 2026 16:53
@yordis
yordis force-pushed the yordis/test-migrate-custom-schema branch from de8d4cb to 5727f9a Compare October 26, 2026 16:54
@yordis
yordis added this pull request to stack #74 October 26, 2026 17:10
…when several event stores share a database

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/test-migrate-custom-schema branch from 5727f9a to 6a43262 Compare October 26, 2026 17:46
@yordis
yordis merged commit 534bd0c into main Oct 26, 2026
3 checks passed
@yordis
yordis deleted the yordis/test-migrate-custom-schema branch October 26, 2026 17:46
@yordis yordis changed the title test(migrations): catch migrations that run against the wrong schema when several event stores share a database chore(test): catch migrations that run against the wrong schema when several event stores share a database Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant