How to execute codeigniter migration

March 7th, 2012 § 0 comments

The Official Codeigniter userguide have a well written document about how to write a migration in codeigniter. But It missed  one, “How run/execute the migration?”. I am not sure whether I missed or codeigniter did. But at last I found my own way to execute the migration and it works fine for me. I am not sure whether this is right way.

I create a controller named “migration” and added a index action to it. The index action will accept a parameter, version number.

Then I invoke the migration via browser.

For Eg: If I need to migrate to version number 10,
I use http://localhost/index.php/migrate/index/10 in browser.

I appreciate, if you can share a better way to execute migration in codeigniter.
Thank you.

Revath S Kumar [RSK]

- Rubyist / JavaScripter - Yeoman Team member - Open source enthusiast - Blogger @ PHPRepo and - Coder @ Whatznear - Google fanboy - jQuery lover

More Posts - Website - Twitter - Facebook - LinkedIn - Pinterest - Google Plus - YouTube