Skip to content

Conversation

@rgraff
Copy link
Contributor

@rgraff rgraff commented Oct 20, 2025

such as @disable_ddl_transaction and @disable_migration_lock

Fixes #610

I was not able to get a failing test for this bug. Ecto would not error, but would give a warning. I have two tests and one generates a warning and the other does not. Since they both pass (even with warnings), it's not a reliable regression test.

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

@rgraff rgraff force-pushed the fix/tenant-migrations-should-honor-module-attributes branch from 71577c9 to 3073ca0 Compare October 20, 2025 23:22
such as @disable_ddl_transaction and @disable_migration_lock
@rgraff rgraff force-pushed the fix/tenant-migrations-should-honor-module-attributes branch from 3073ca0 to 89c913b Compare October 20, 2025 23:26
@rgraff rgraff closed this Oct 20, 2025
@rgraff rgraff reopened this Oct 20, 2025
@rgraff
Copy link
Contributor Author

rgraff commented Oct 20, 2025

While this fix may work--I'm not 100% certain given the difficulty in testing.

And there's another complication. You still can't do do schema migrations that use the concurrently: true option in test suites, since sandboxes are always in a transaction.

Maybe the migration generator needs to do something like this

create index(:posts, [:title], concurrently: Mix.env() != :test)

@zachdaniel
Copy link
Contributor

Yeah, that makes sense 🤔 We probably will need to figure some other kind of thing out here because you could also be running this in an action that is in a transaction. I'm not sure what the right answer is? Maybe some kind of error if you are in a transaction currently, that can be silenced in test?

@rgraff
Copy link
Contributor Author

rgraff commented Oct 21, 2025 via email

@zachdaniel
Copy link
Contributor

That is a good point. Then future migrations are applied "out of band" out of a transaction. Smart 👍

…tributes

* main: (23 commits)
  fix: do not build query filter with or: [] when all records are successfully inserted, for return_skipped_upsert?: true (#659)
  test: load aggregate with select and sort on from_many relationship (#661)
  test: add failing test for expr(has_one.function_calc) nil poisoning in batch (#660)
  test: aggregate with parent ref in relationship filter and sorting on relationship field (#658)
  test: binding error when loading aggregate (#657)
  chore(deps): bump ash_sql in the production-dependencies group (#656)
  test: multi relationship problems (#654)
  chore: release version v2.6.26
  chore: update ash_sql, use new select binding
  test: add complex calculation tests with filtered aggregates (#652)
  improvement: add generator to tsvector type (#655)
  test: add failing test for aggregate filtering on nested first aggregate (#653)
  chore: update ash_sql and add test
  docs: Mention :define_ecto_repo? option of use AshPostgres.Repo macro in getting started guide (#648)
  improvement: verify check constraint attributes at compile time
  chore: update ash
  chore: reuse compliance
  improvement: update deps for bug fixes
  chore: release version v2.6.25
  test: Add failing test for aggregate with parent() + select() + limit() (#644)
  ...
@rgraff rgraff marked this pull request as draft December 11, 2025 00:17
@rgraff
Copy link
Contributor Author

rgraff commented Dec 11, 2025

@zachdaniel I made some updates changes here to get concurrent indexes working for tenants. I need to add tests and QA this in a personal project, but wanted to get feedback when you're back from vacation.

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.

Creating indexes concurrently fails for schema-driven multi-tenancy

3 participants