0

I can't migrating down with commande line php bin/console doctrine:migrations:migrate DoctrineMigrations\Version20220713135119

PS C:\_EnvTest\my_project_composer2> php bin/console doctrine:migrations:migrate  DoctrineMigrations\Version20220713135119     

 WARNING! You are about to execute a migration in database "agencegrafikart" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > 

[notice] Migrating down to DoctrineMigrations\Version20220713135119
[error] Migration DoctrineMigrations\Version20220718131542 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42P06]: Duplicate schema: 7 ERROR:  le schema « public » already exist"

In ExceptionConverter.php line 91:

  An exception occurred while executing a query: SQLSTATE[42P06]: Duplicate schema: 7 ERROR:  schema « public » already exist


In Exception.php line 30:

  SQLSTATE[42P06]: Duplicate schema: 7 ERROR:  le schema « public » already exist  


In Connection.php line 72:

  SQLSTATE[42P06]: Duplicate schema: 7 ERROR:  le schema « public » already exist

My migration :

        $this->addSql('CREATE SCHEMA public');
        $this->addSql('ALTER TABLE option_property DROP CONSTRAINT FK_AB856D7AA7C41D6F');
        $this->addSql('DROP SEQUENCE option_id_seq CASCADE');
        $this->addSql('DROP TABLE option');
        $this->addSql('DROP TABLE option_property');
1
  • Please share more details. CREATE SCHEMA does not look like something from a DOWN migration Commented Jul 18, 2022 at 15:28

1 Answer 1

1

I just commented :

$this->addSql('CREATE SCHEMA public');

And run the command again and it seems to work.

github.com/doctrine/migrations/issues/494

Sign up to request clarification or add additional context in comments.

1 Comment

Ok then please close your question! -

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.