Skip to content

fix: run tenant migrations from mix ash.setup - #836

Merged
zachdaniel merged 1 commit into
ash-project:mainfrom
TravelCurry02:fix/setup-tenant-migrations
Aug 21, 2026
Merged

fix: run tenant migrations from mix ash.setup#836
zachdaniel merged 1 commit into
ash-project:mainfrom
TravelCurry02:fix/setup-tenant-migrations

Conversation

@TravelCurry02

Copy link
Copy Markdown
Contributor

Fixes #807.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

mix ash.setup was supposed to run tenant migrations after public ones, but it never did.

Three bugs:

  • has_tenant_migrations?/1 returned true when there were no tenant files
  • the second ash_postgres.migrate call was skipped because Mix won't run the same task twice (run vs rerun)
  • it passed --tenant instead of --tenants

This inverts the check, uses Mix.Task.rerun/2 with --tenants, does the same for the test.reset alias, and adds regression tests.

Fixes ash-project#807.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zachdaniel
zachdaniel merged commit 8324aa7 into ash-project:main Aug 21, 2026
115 of 125 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

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

Labels

None yet

Projects

None yet

2 participants