How do I run CodeIgniter migrations?

前端 未结 5 1607
我寻月下人不归
我寻月下人不归 2020-12-12 23:42

I know how to create them via http://codeigniter.com/user_guide/libraries/migration.html

But once I\'ve created my migration files, how do I run them?

5条回答
  •  [愿得一人]
    2020-12-13 00:44

    I am not sure this is the right way to do it, But It works for me.

    I created a controller named migrate (controllers/migrate.php).

    load->library("migration");
    
          if(!$this->migration->version($version)){
              show_error($this->migration->error_string());
          }   
        }
    }
    

    Then from browser I will call this url to execute index action in migrate controller
    Eg : http://localhost/index.php/migrate/index/1

提交回复
热议问题