Skip to content

doctrine:schema:validate returns DROP TABLE doctrine_migration_versions; #1406

@ValentinDk

Description

@ValentinDk

BC Break Report

Q A
BC Break yes
Version 3.0.0

Summary

When I updated doctrine/orm to version 3.0.0, my CI started to fail due to the doctrine:schema check:validate, which returned DROP TABLE doctrine_migration_versions;

I found that adding schema_filter can fix this problem: "^(?!doctrine_migration_versions$)" in the dbal configuration, indeed, then the error no longer appears, but after that my migrations stopped tracking the current state and think that at the moment no migration has been performed.

In version 3.0, the saveMode argument was removed in \Doctrine\ORM\Tools\SchemaTool::getUpdateSchemaSql and because of this, doctrine:schema:validate tracks deleted tables and returns sql for this action.
telegram-cloud-photo-size-2-5384566650814190356-y

Previous behavior

image

Current behavior

image

How to reproduce

  1. composer require doctrine/doctrine-migrations-bundle
  2. composer require doctrine/orm-pack
  3. bin/console doctrine:migration:diff
  4. bin/console doctrine:migration:migrate
  5. bin/console doctrine:schema:validate -v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions