Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations: use a txn + commit for each migration, deprecate MigrateTx #600

Merged
merged 3 commits into from
Sep 22, 2024

Commits on Sep 20, 2024

  1. Configuration menu
    Copy the full SHA
    e3b3b55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    30d0691 View commit details
    Browse the repository at this point in the history
  3. deprecate MigrateTx, convert tests to use schemas

    As detailed in #600, there are certain combinations of schema changes
    which are not allowed to be run within the same transaction. The example
    we encountered with #590 is adding a new enum value, then using it in an
    immutable function during a subsequent migration. In Postgres, these
    must be separated by a commit.
    
    There are other examples of things which cannot be run in a transaction,
    such as `CREATE INDEX CONCURRENTLY`. While that specific one isn't
    solved here, moving away from a migrator that bundles migrations into a
    single transaction will also allow us to update our migration system to
    exclude certain migrations from transactions and i.e. add indexes
    concurrently.
    bgentry committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    c0de0ae View commit details
    Browse the repository at this point in the history