migrations icon indicating copy to clipboard operation
migrations copied to clipboard

skipIf throw Exception on following Migrations

Open Aluok opened this issue 1 year ago • 1 comments

Bug Report

Q A
BC Break no
Version 3.7.2

Summary

Firstly, thank you for your hard work. Then, we want to use the skipIf method to manage feature flags while keeping the process automated. As per the doc, we expect it to skip the migration, and continue with the following afterwards.

Current behavior

The skipIf does skip the current migration without problems if it is the last one. If the migration using it is followed by a migration which is not skipped, the following error occurs : Transaction commit failed because the transaction has been marked for rollback only.

How to reproduce

A quick project can be setup with Symfony as

composer create-project symfony/skeleton:"5.4.*" .
composer require orm
composer require doctrine/migrations

Then create 3 migrations, use $this->skipIf(true) in the middle one, and run all migrations

Expected behavior

the command should terminate, and the list should show that the first and last were executed, but not the middle one.

Aluok avatar Dec 14 '23 14:12 Aluok

I found out the same problem. I don't understand why the migration is marked as rollback since it does not have to be performed

DominicDetta avatar Feb 23 '24 16:02 DominicDetta