mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-09 01:23:10 +03:00
Created migration class for new setting (#182).
This commit is contained in:
parent
2b00e27b48
commit
1c6ba6308b
2 changed files with 37 additions and 1 deletions
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 5; // current
|
||||
$config['migration_version'] = 6; // current
|
||||
|
||||
|
||||
/*
|
||||
|
|
36
src/application/migrations/006_add_calendar_view_setting.php
Normal file
36
src/application/migrations/006_add_calendar_view_setting.php
Normal 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');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue