CodeIgniter Forums
Run migration - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Choosing CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=8)
+--- Thread: Run migration (/showthread.php?tid=75131)



Run migration - nefone - 12-28-2019

Hello!
How can I run a migration in CodeIgniter?


RE: Run migration - jreklund - 12-29-2019

You mean upgrading to a new version? It's in the manual.
Up to 3.x
https://codeigniter.com/user_guide/installation/upgrading.html

From 3.x to 4.x
https://codeigniter4.github.io/userguide/installation/upgrade_4xx.html


RE: Run migration - nefone - 12-30-2019

Solved problems with the controller
PHP Code:
<?php defined('BASEPATH') or exit('go home');


class 
Migrate extends CI_Controller
{
    /**
     * Запуск миграций в проекте.
     */
    public function index()
    {
        $this->load->library('migration');

        if ($this->migration->current() === FALSE)
        {
            show_error($this->migration->error_string());
        }
    }