Errors during migration 2.1 -> 3.1
spammads opened this issue · comments
Hi,
followed update-strategy to the word.
Value in .env-File (due to docker-swarm):
DATABASE_URL=mysql://user:password@davis_db:3306/davis?charset=utf8mb4&serverVersion=mariadb-10.10.2
Got following errors during call of bin/console doctrine:migrations:migrate
:
/var/www/davis/bin # ./console doctrine:migrations:migrate
WARNING! You are about to execute a migration in database "davis" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
yes
[notice] Migrating up to DoctrineMigrations\Version20221106220412
[error] Migration DoctrineMigrations\Version20221106220411 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'"
08:04:41 CRITICAL [console] Error thrown while running command "doctrine:migrations:migrate". Message: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'" ["exception" => Doctrine\DBAL\Exception\DriverException^ { …},"command" => "doctrine:migrations:migrate","message" => "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'"]
In ExceptionConverter.php line 119:
An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'
In Exception.php line 30:
SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'
In Connection.php line 72:
SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'UNIQ_E797E7FB841CB121'
Hi
Thanks for the report.
Can you try:
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20221106220411' --add --no-interaction
And then retry bin/console doctrine:migrations:migrate
?
NB: You should have already done:
bin/console doctrine:migrations:sync-metadata-storage
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20191030113307' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20191113170650' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20191125093508' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20191202091507' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20191203111729' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20210928132307' --add --no-interaction
bin/console doctrine:migrations:version 'DoctrineMigrations\Version20221106220411' --add --no-interaction
Adding this one worked.
Status now says 1 Migration is Postgresql-specific so it can be skipped in my case.
Thanks.
And thanks for the nice work on this one.
Perfect. I amended the release note, it was probably an oversight