From 7c620c67340d19dd2713eeed7bb7f00fac5231d8 Mon Sep 17 00:00:00 2001 From: alext Date: Tue, 6 Mar 2018 22:46:33 +0100 Subject: [PATCH] Added time format setting in the database and created migration file. --- src/application/config/migration.php | 2 +- .../010_add_time_format_setting.php | 27 +++++++++++++++++++ src/assets/sql/data.sql | 3 ++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/application/migrations/010_add_time_format_setting.php diff --git a/src/application/config/migration.php b/src/application/config/migration.php index 9504a9cc..1546ae4d 100644 --- a/src/application/config/migration.php +++ b/src/application/config/migration.php @@ -37,7 +37,7 @@ $config['migration_table'] = 'ea_migrations'; | be upgraded / downgraded to. | */ -$config['migration_version'] = 9; // current +$config['migration_version'] = 10; // current /* diff --git a/src/application/migrations/010_add_time_format_setting.php b/src/application/migrations/010_add_time_format_setting.php new file mode 100644 index 00000000..87716625 --- /dev/null +++ b/src/application/migrations/010_add_time_format_setting.php @@ -0,0 +1,27 @@ + + * @copyright Copyright (c) 2013 - 2018, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.3.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_time_format_setting extends CI_Migration { + public function up() + { + $this->db->insert('ea_settings', [ + 'name' => 'time_format', + 'value' => 'regular' + ]); + } + + public function down() + { + $this->db->delete('ea_settings', ['name' => 'time_format']); + } +} diff --git a/src/assets/sql/data.sql b/src/assets/sql/data.sql index 08842044..36b87090 100644 --- a/src/assets/sql/data.sql +++ b/src/assets/sql/data.sql @@ -15,6 +15,7 @@ VALUES ('google_analytics_code', ''), ('customer_notifications', '1'), ('date_format', 'DMY'), + ('time_format', 'regular'), ('require_captcha', '0'); -INSERT INTO `ea_migrations` VALUES ('9'); +INSERT INTO `ea_migrations` VALUES ('10');