You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed the generated migrations are using SQL instead of the Schema class methods. I think the most logic thing to do is to use those methods. Right now it generates a SQL command for the RDBM in use (in my case, mysql), but if i want to change to Postgres for example, i have to rebuild all my migrations.
The text was updated successfully, but these errors were encountered:
This bundles simply integrates the Doctrine DataFixtures library. It does nothing about generating the code of the migrations, which is why I close this issue.
And the reason why DataFixtures uses SQL is that it gives the developer full power about adding additional queries at any state of the migration whereas the Schema does not. A good example where it is needed is the addition of a unique field in a table. If you do the full schema migration, it will fail as soon as there is at least 2 rows in the table because both are set to the same default value => not unique. DataFixtures generates 2 queries to do this migration: adding the field and then adding the unique constraint. This makes it possible to add a third query between them that populate the new field with some unique data (copying the primary key for instance)
I've noticed the generated migrations are using SQL instead of the Schema class methods. I think the most logic thing to do is to use those methods. Right now it generates a SQL command for the RDBM in use (in my case, mysql), but if i want to change to Postgres for example, i have to rebuild all my migrations.
The text was updated successfully, but these errors were encountered: