AliceFixturesBundle icon indicating copy to clipboard operation
AliceFixturesBundle copied to clipboard

h4cc_alice_fixtures:load:files trunkates migration_versions table

Open cosma opened this issue 10 years ago • 4 comments

the command h4cc_alice_fixtures:load:files --drop should not truncate the doctrine migrations table(default is migration_versions ), if there's any .

cosma avatar Jun 25 '15 09:06 cosma

There is no truncating. The whole table will be removed and recreated.

Currently, the Schema is dropped by removing all tables from database: https://github.com/h4cc/AliceFixturesBundle/blob/master/ORM/DoctrineORMSchemaTool.php#L45

Maybe this could be changed to use this method in the schema tool: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/SchemaTool.php#L719

h4cc avatar Jun 25 '15 10:06 h4cc

You are right, the default behaviour is drop ans recreate. Sorry for confusing you, in my app I changed the default behaviour to truncate, as being faster. DB update is kept by doctrine migrations.

The main idea is that command shouldn't drop/truncate the doctrine migration table, if there's one.

cosma avatar Jun 26 '15 06:06 cosma

Looks like a different ORM\DropStrategy to me. Something not yet existing.

Have you seen Alice v2.0 is out? I am thinking about upgrading this bundle to that version.

h4cc avatar Jun 26 '15 06:06 h4cc

Now I know. :-)

I guess my idea will introduce a dependency to doctrine migrations bundle ...

cosma avatar Jun 26 '15 07:06 cosma