doctrine / migrations

Doctrine Database Migrations Library
https://www.doctrine-project.org/projects/migrations.html
MIT License
4.65k stars 386 forks source link

skipIf throw Exception on following Migrations #1384

Open Aluok opened 7 months ago

Aluok commented 7 months ago

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.

DominicDetta commented 5 months ago

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