Reputation: 20492
Here is the legacy documentation explaining what "generate-migrations-db" does:
http://symfony.com/legacy/doc/doctrine/1_2/en/07-Migrations
It says
Generate migration classes from existing database connections (doctrine-generate-migrations-db, doctrine-gen-migrations-from-db)
Also:
Generating Migrations
Doctrine offers the ability to generate sets of migration classes for existing databases or existing models as well as generating blank migration classes for you to fill in with the code to make your schema changes.
From Database
If you have an existing database you can build a set of migration classes that will re-create your database by running the following command.
$ ./symfony doctrine:generate-migrations-db
In other words: it takes the schema from the database and generates a migration that performs that schema creation. No entities, no classes, no mappings are used in this process. It just takes a DB and builds a migration class.
We do not have generate-migrations-db
anymore. Do we have something that performs that task? I couldn't find. If it was replaced by some other command, please let me know. If it was just removed, please let know.
Upvotes: 3
Views: 3602
Reputation: 6610
I'm not aware of a command in Doctrine or the Migrations Bundle that creates migration files for an existing database.
So here's how I did it instead:
php app/console doctrine:migrations:diff
. This will create a migrations file that creates your database tables etc from scratchHope this is helpful.
Upvotes: 6
Reputation: 10085
Take a look at the DoctrineMigrationsBundle, which can generate migration classes with sql statements for migration.
Upvotes: 1