Skip to content

Migration: fail if migration contains more than one query #373

@g105b

Description

@g105b

If a migration contains more than one query, such as a migration that adds a new column to a table, and then immediately adds a foreign key to that new column, the migration should FAIL.

This is because, if the first part of the migration succeeds, and the second part fails, the migration will not have been recorded to have ran successfully, yet the first half of the operation did actually succeed - leaving the database out of integrity.

This only needs to be done at the point of performing the migration, where currently we split the migration on the semicolon using a lexer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNon-breaking improvements to existing behaviour

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions