doctrine/DoctrineMigrationsBundle

doctrine:migrations:diff generates DROP SEQUENCE messenger_messages_id_seq

Gemorroj opened this issue · 6 comments

After run doctrine:migrations:diff it generates

$this->addSql('DROP SEQUENCE schema.messenger_messages_id_seq CASCADE');

It bug relates to #355 but the solution schema_filter: ~^(?!messenger_messages)~ doesn't help

im use postgres

Hi! I have the same problem.

I hope problem with schema
i'm tryed to change my_schema -> public
and problem was solved, but I need use schema....

I'm also experiencing this. Every migration diff tries to drop some sequence tokens and I don't know what changed other than upgrading to the latest doctrine. Also in postgres.

On my setup at each doctrine:migration:diff it adds me twice the lines creating the table messenger_messages

I do have the same issue. I reported it on this related issue. .

Not only does it drop the sequences on up, but it also recreates them on down and additionally recreates the schemas.

Note that the issue of dropping SEQUENCES only happens when there's a custom SCHEMA.

The full code is available on this repository.

MkLHX commented

Hi there,

Still encountering the issue in my project and I need to use multiple schemas on PostgreSQL.

My project stack is as follows:

SF 6.1.12
PHP 8.1.9
"doctrine/doctrine-bundle": "^2.7",
"avaibooksports/doctrine-migrations-multiple-database-bundle": "^0.3.4",

4 Entity Managers/Connection
4 PostgreSQL databases on docker postgis/postgis:14-3.3

When I apply a migration on all or one database, with custom schemas, the table's sequences are dropped.

I really can't move custom schemas tables to the public schema to much work is already done with custom schemas.

Did you find any workaround to manage migrations and keep sequences when applied?

4 Entity Managers/Connection 4 PostgreSQL databases on docker postgis/postgis:14-3.3

Having the issue using postgis / docker too, maybe it is related