Skip to content

DoctrineMigrationToolsBundle not working with organize_migrations #11

@florianperreon

Description

@florianperreon

Hi
This bundle does not work with this doctrine_migrations configuration :
doctrine_migrations:
organize_migrations: BY_YEAR_AND_MONTH

in this file : class DiffFileCommand extends \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand

this function : getLastSchemaDefinition($configuration)
is not good if SchemaVersion files are not in the same folder
$dir = $migrationDirectoryHelper->getMigrationDirectory().'/SchemaVersion';
=> will only search in the current month

For exemple :
2020/03/SchemaVersion/Schema202003********
2020/03/SchemaVersion/Schema202003********
2020/03/SchemaVersion/Schema202003********

And we are now in 2020/04

When we execute diff-file command : bundle consider that there is no LastSchemaDefinition : migration file is generated with all sql requests from a new database

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