Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table migration_versions wants to be deleted after updating to Symfony 7.1 #554

Open
dmitryuk opened this issue Sep 18, 2024 · 1 comment

Comments

@dmitryuk
Copy link

dmitryuk commented Sep 18, 2024

After updating the to Symfony 7.1 Command bin/console doctrine:schema:validate -v return an error:

 [ERROR] The database schema is not in sync with the current mapping file.                                              
                                                                                                                        
 // 1 schema diff(s) detected:                                                                                          

     DROP TABLE migration_versions;

I tried to filter the table, but migration command fails

orm:
    dbal:
      ...
       schema_filter: ~^(?!migration_versions)~

//   SQLSTATE[42P07]: Duplicate table: 7 ERROR:  relation "migration_versions" already exists  

Any help needed

UPD: found that \Doctrine\DBAL\Schema\SchemaDiff::toSaveSql after updating DBAL changed variable saveMode from false to true
and the code below is evaluated:

        if ($saveMode === false) {
            $sql = array_merge($sql, $platform->getDropTablesSQL($this->getDroppedTables()));
        }
@dmitryuk
Copy link
Author

Related doctrine/migrations#1406 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant