You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When updating an enum multiple values can't be added at the same time so it requires one update statement per value. Altering types in postgres can't be done a mutli-command string which is how the migrations are executed. This requires one migration file per alter statement which can inflate the number of migration files by quite a lot. We've already run into this issue with two different enum causing us to create 9 different migration files. Is it possible to add a feature to allow multiple single queries with a comment between each to break up the multi-command strings?
Example:
-- postgres-migrations disable-transaction
ALTER TYPE test_type ADD VALUE 'Manual';
ALTER TYPE test_type ADD VALUE 'Automatic';
Error: ALTER TYPE ... ADD cannot be executed from a function or multi-command string
The text was updated successfully, but these errors were encountered:
I must admit, my time for maintenance on this library is minimal, so it's unlikely I'll spend time implementing this.
That said, this is a case I would consider support for.
I'd happily discuss a proposal on how this would look, and if we can agree on a design I would accept a PR with:
implementation
tests
docs
As part of a proposal I would like to hear how other libraries in this space (including other languages) handle this problem. If this is a solved problem elsewhere I'd like to know about it first before committing to a design.
When updating an enum multiple values can't be added at the same time so it requires one update statement per value. Altering types in postgres can't be done a mutli-command string which is how the migrations are executed. This requires one migration file per alter statement which can inflate the number of migration files by quite a lot. We've already run into this issue with two different enum causing us to create 9 different migration files. Is it possible to add a feature to allow multiple single queries with a comment between each to break up the multi-command strings?
Example:
Error:
ALTER TYPE ... ADD cannot be executed from a function or multi-command string
The text was updated successfully, but these errors were encountered: