Created migration class for new setting (#182).

This commit is contained in:
Alex Tselegidis 2016-07-17 12:37:00 +02:00
parent 2b00e27b48
commit 1c6ba6308b
2 changed files with 37 additions and 1 deletions

View file

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

View file

@ -0,0 +1,36 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) 2013 - 2016, Alex Tselegidis
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
* @link http://easyappointments.org
* @since v1.2.0
* ---------------------------------------------------------------------------- */
class Migration_Add_calendar_view_setting extends CI_Migration {
public function up() {
$this->load->dbforge();
$fields = [
'calendar_view' => [
'type' => 'VARCHAR',
'constraint' => '32',
'default' => 'default',
'null' => true
]
];
$this->dbforge->add_column('ea_user_settings', $fields);
$this->db->update('ea_user_settings', ['ea_user_settings' => 'default']);
}
public function down() {
$this->load->dbforge();
$this->dbforge->drop_column('ea_user_settings', 'calendar_view');
}
}