You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running doctrine:migrations:diff multiple times without any changes and with existing table in database always generate the same code trying to create table with schema and delete the very same table without schema.
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE TABLE public.users (id SERIAL NOT NULL, username VARCHAR(64) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2552C48DF85E0677 ON public.users (username)');
Run doctrine:migrations:migrate and table is created succesfully in database.
Run doctrine:migrations:diff and new migration is generated:
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE TABLE public.users (id SERIAL NOT NULL, username VARCHAR(64) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2552C48DF85E0677 ON public.users (username)');
$this->addSql('DROP TABLE users');
Of course next running doctrine:migrations:migrate ends with error
relation "users" already exists
Comment
I don't know if this behavior is related to laravel-doctrine or doctrine itself so I also created bug report in doctrine issue tracker
The text was updated successfully, but these errors were encountered:
Summary
Running
doctrine:migrations:diff
multiple times without any changes and with existing table in database always generate the same code trying to create table with schema and delete the very same table without schema.How to reproduce
On any project create entity:
Run
doctrine:migrations:diff
Generated migration is ok now:
Run
doctrine:migrations:migrate
and table is created succesfully in database.Run
doctrine:migrations:diff
and new migration is generated:Of course next running
doctrine:migrations:migrate
ends with errorComment
I don't know if this behavior is related to laravel-doctrine or doctrine itself so I also created bug report in doctrine issue tracker
The text was updated successfully, but these errors were encountered: