Add a config item for knowing if v2 migration took place

这个提交包含在:
Peter Goodhall 2022-10-10 19:56:46 +01:00
父节点 08d6294e34
当前提交 22f421e9eb
共有 4 个文件被更改,包括 59 次插入21 次删除

查看文件

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 101;
$config['migration_version'] = 102;
/*
|--------------------------------------------------------------------------

查看文件

@ -11,6 +11,8 @@ class Welcome extends CI_Controller {
public function index()
{
if($this->config->item('option_version2_trigger') == "false") {
$data['page_title'] = "Welcome to Cloudlog Version 2.0";
// load stations model
@ -33,6 +35,9 @@ class Welcome extends CI_Controller {
$this->load->view('interface_assets/mini_header', $data);
$this->load->view('welcome/index');
$this->load->view('interface_assets/footer');
} else {
redirect('login');
}
}
public function locationsclaim() {

查看文件

@ -0,0 +1,25 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* This migration creates a table called options which will hold global options needed within cloudlog
* removing the need for lots of configuration files.
*/
class Migration_add_version_two_trigger_to_options extends CI_Migration {
public function up()
{
$data = array(
array('option_name' => "version2_trigger", 'option_value' => "false", 'autoload' => "yes"),
);
$this->db->insert_batch('options', $data);
}
public function down()
{
// No option to down
}
}

查看文件

@ -1,3 +1,6 @@
<?php
echo $this->config->item('option_version2_trigger');
?>
<div class="container">
<br>
@ -149,4 +152,9 @@
</div>
<br>
<button class="btn btn-primary" onClick="window.location.reload();">Check if Migration Complete</button>
<br><br>
</div>