From 481d6990e40434c0dfd4e1961fc3bca5320cd403 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Mon, 7 Mar 2016 23:06:15 +0100 Subject: [PATCH] Database migration to lower and higher versions. --- application/controllers/Migrate.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/application/controllers/Migrate.php b/application/controllers/Migrate.php index 012b23b..4ec42fd 100644 --- a/application/controllers/Migrate.php +++ b/application/controllers/Migrate.php @@ -13,7 +13,17 @@ class Migrate extends CI_Controller $this->load->library('migration'); } - public function index() + public function version($id = NULL) + { + if ($this->migration->version($id) === FALSE) + { + show_error($this->migration->error_string()); + } else { + echo "Database moved to: ".$id; + } + } + + public function latest() { if ($this->migration->latest() === FALSE) { @@ -21,7 +31,6 @@ class Migrate extends CI_Controller } else { echo "Database updated or update not needed."; } - } }