Browse Source

Enable controlled database upgrades.

master
Rogier Neeleman 9 years ago
parent
commit
a5214e59a3
  1. 2
      application/config/migration.php
  2. 28
      application/controllers/Migrate.php

2
application/config/migration.php

@ -11,7 +11,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); @@ -11,7 +11,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
$config['migration_enabled'] = TRUE;
/*
|--------------------------------------------------------------------------

28
application/controllers/Migrate.php

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Migrate to next database release
*/
class Migrate extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('migration');
}
public function index()
{
if ($this->migration->latest() === FALSE)
{
show_error($this->migration->error_string());
} else {
echo "Database updated or update not needed.";
}
}
}
?>
Loading…
Cancel
Save