-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 5.0.8
Description
I installed the messenger component and setup the default transport to be doctrine. I left the auto_setup
config to true and the messenger_messages table was created and thats all working fine.
The issue I've got is when I next ran php bin/console make:migration
as I'd added a new Entity, the migration dropped the messenger_messages table:
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
// Redacted queries to add my entity here
$this->addSql('DROP TABLE messenger_messages');
}
How to reproduce
- Install messenger
composer require symfony/messenger
- Set
doctrine://default
as the messenger transport - Push a message to the queue
- See that the table messenger_messages is created
- Add an entity via the cli
- Run
php bin/console make:migration
- See that the latest migration has a drop statement for the messenger_messages table
Possible Solution
If auto_setup is true then exclude the messenger_messages from any future migrations.