I have a CodeIgniter application and I just learned about migrations. It sounds very useful and I would like to start using it. However I already have a rather complex database setup. Can someone suggest a reasonable way to create a reliable initial migration from my MYSQL .sql schema file?
It seems excessive to manually recreate the entire db with dbforge, but perhaps that's what I ought to do.
To create a script file containing the DDL statements used to perform the migration, select the Generate SQL checkbox in the Run dialog box when you execute the migration. In the text-entry field next to the checkbox, type the name of the file to which you want the script written.
The database table migration tracks which migrations have already been run so all you have to do is update your application files and call $this->migration->current() to work out which migrations should be run. The current version is found in application/config/migration. php.
Bit late reply, but I hacked a quick library that should generate the base migration file for you from your current DB. Its still beta, but works on my systems 40 tables+
https://github.com/liaan/codeigniter_migration_base_generation
L:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With