mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-23 00:13:21 +03:00
Added migration that add the "google_analytics_code" setting in the database.
This commit is contained in:
parent
722daac2cd
commit
e0c3c0eba5
3 changed files with 81 additions and 53 deletions
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
| be upgraded / downgraded to.
|
| be upgraded / downgraded to.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['migration_version'] = 1; // current
|
$config['migration_version'] = 2; // current
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -14,17 +14,21 @@
|
||||||
class Migration_Specific_calendar_sync extends CI_Migration {
|
class Migration_Specific_calendar_sync extends CI_Migration {
|
||||||
|
|
||||||
public function up() {
|
public function up() {
|
||||||
|
if (!$this->db->field_exists('google_calendar', 'ea_user_settings')) {
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'google_calendar' => array(
|
'google_calendar' => array(
|
||||||
'type' => 'VARCHAR',
|
'type' => 'VARCHAR',
|
||||||
'constraint' => '128',
|
'constraint' => '128',
|
||||||
'null' => TRUE)
|
'null' => TRUE
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->dbforge->add_column('ea_user_settings', $fields);
|
$this->dbforge->add_column('ea_user_settings', $fields);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down() {
|
||||||
|
if ($this->db->field_exists('google_calendar', 'ea_user_settings')) {
|
||||||
$this->dbforge->drop_column('ea_user_settings', 'google_calendar');
|
$this->dbforge->drop_column('ea_user_settings', 'google_calendar');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?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 - 2015, Alex Tselegidis
|
||||||
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||||
|
* @link http://easyappointments.org
|
||||||
|
* @since v1.0.0
|
||||||
|
* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
class Migration_Add_google_analytics_setting extends CI_Migration {
|
||||||
|
public function up() {
|
||||||
|
$this->load->model('settings_model');
|
||||||
|
$this->settings_model->set_setting('google_analytics_code', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down() {
|
||||||
|
$this->load->model('settings_model');
|
||||||
|
$this->settings_model->remove_setting('google_analytics_code');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue