diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-08-15 11:23:07 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-08-15 11:23:07 +0200 |
commit | 9c5bfbee5b42ea50a5611c537b8dbf01d7a64f79 (patch) | |
tree | 522e4b69d9d10139919789efb4421cb863cf0a4d /application/controllers | |
parent | 4b21c998592fc724e75ef5e00a28e9c7c9d89cc1 (diff) |
tools/update_database: Output status after upgrade
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/tools.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/application/controllers/tools.php b/application/controllers/tools.php index c3209e8f7..9e0ddfb5f 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -36,9 +36,18 @@ class Tools extends MY_Controller { function update_database() { $this->load->library('migration'); - if ( ! $this->migration->current()) { + $upgraded = $this->migration->current(); + if ( ! $upgraded) { throw new \exceptions\ApiException("tools/update_database/migration-error", $this->migration->error_string()); } + + if ($upgraded === true) { + echo "Already at latest database version. No upgrade performed\n"; + } + + if (is_int($upgraded)) { + echo "Database upgraded sucessfully to version: $upgraded\n"; + } } function drop_all_tables() |