Moving to the current version with current()

To simply alter your database so that it corresponds with the version number in $config['migration_version'], you should use the current() function.

Getting ready

Ensure that you have followed the preceding recipe, Using CodeIgniter database migrations.

How to do it...

  1. Using your command line (terminal application), navigate to the root of your CodeIgniter installation (where the index.php file is) and type the following:
    php index.php migrate current

How it works...

Consider the following command line:

php index.php migrate current 

The first thing we should bear in mind is the constructor in the migrate controller. The constructor is looking at how the migrate controller is accessed; it'll deny access to the ...

Get CodeIgniter 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.