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

Errors during backfill don't cause a rollback #316

Closed
andrew-farries opened this issue Mar 12, 2024 · 0 comments · Fixed by #317
Closed

Errors during backfill don't cause a rollback #316

andrew-farries opened this issue Mar 12, 2024 · 0 comments · Fixed by #317
Assignees
Labels
bug Something isn't working

Comments

@andrew-farries
Copy link
Collaborator

To reproduce:

  • Run the following pair of migrations:
{
  "name": "01_create_table",
  "operations": [
    {
      "create_table": {
        "name": "users",
        "columns": [
          {
            "name": "id",
            "type": "serial",
            "pk": true
          },
          {
            "name": "name",
            "type": "varchar(255)",
            "unique": true
          }
        ]
      }
    }
  ]
}
{
  "name": "02_change_type",
  "operations": [
    {
      "alter_column": {
        "up": "invalid",
        "down": "invalid",
        "type": "text",
        "table": "users",
        "column": "name"
      }
    }
  ]
}

Expected behaviour:

  • The second migration fails during the backfill step and is rolled back. Further migrations are able to be run against the users table.

Actual behaviour:

  • The second migration is not rolled back, blocking further migrations against the users table.
@andrew-farries andrew-farries added the bug Something isn't working label Mar 12, 2024
@andrew-farries andrew-farries self-assigned this Mar 12, 2024
andrew-farries added a commit that referenced this issue Mar 12, 2024
Ensure that migrations that fail during backfill are rolled back.

Add testcases to ensure rollback occurs when an error occurs:
* during the DDL phase of migration start
* during the backfill phase of migration start

Fixes #316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant