Skip to content

Error running statements that can't be run as a multi-command string #81

@stevehogdahl

Description

@stevehogdahl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions