To simply alter your database so that it corresponds with the version number in $config['migration_version']
, you should use the current()
function.
Ensure that you have followed the preceding recipe, Using CodeIgniter database migrations.
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
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 migrate controller if it is accessed via anything other than the command line—a useful security measure.
By typing the command we just saw, you'll run public function current()
. The function accepts no parameter. CodeIgniter will look into the migrations...