diff --git a/src/application/config/migration.php b/src/application/config/migration.php index 56eeb960..b28e9049 100644 --- a/src/application/config/migration.php +++ b/src/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 5; // current +$config['migration_version'] = 6; // current /* diff --git a/src/application/migrations/006_add_calendar_view_setting.php b/src/application/migrations/006_add_calendar_view_setting.php new file mode 100644 index 00000000..57dfdb28 --- /dev/null +++ b/src/application/migrations/006_add_calendar_view_setting.php @@ -0,0 +1,36 @@ + + * @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'); + } +}