From 494e5e53a1e12813571ffc8dabbb426a5b77ea46 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 30 Dec 2015 12:39:36 +0100 Subject: [PATCH] Added migration class for the captcha setting. --- src/application/config/migration.php | 2 +- .../002_add_google_analytics_setting.php | 2 +- ...003_add_customer_notifications_setting.php | 2 +- .../004_add_date_format_setting.php | 2 +- .../005_add_require_captcha_setting.php | 24 +++++++++++++++++++ 5 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/application/migrations/005_add_require_captcha_setting.php diff --git a/src/application/config/migration.php b/src/application/config/migration.php index b1211cff..56eeb960 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'] = 4; // current +$config['migration_version'] = 5; // current /* diff --git a/src/application/migrations/002_add_google_analytics_setting.php b/src/application/migrations/002_add_google_analytics_setting.php index eea920ff..fb177f77 100644 --- a/src/application/migrations/002_add_google_analytics_setting.php +++ b/src/application/migrations/002_add_google_analytics_setting.php @@ -8,7 +8,7 @@ * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 * @link http://easyappointments.org - * @since v1.0.0 + * @since v1.1.0 * ---------------------------------------------------------------------------- */ class Migration_Add_google_analytics_setting extends CI_Migration { diff --git a/src/application/migrations/003_add_customer_notifications_setting.php b/src/application/migrations/003_add_customer_notifications_setting.php index 2b36bd3e..76879327 100644 --- a/src/application/migrations/003_add_customer_notifications_setting.php +++ b/src/application/migrations/003_add_customer_notifications_setting.php @@ -8,7 +8,7 @@ * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 * @link http://easyappointments.org - * @since v1.0.0 + * @since v1.1.0 * ---------------------------------------------------------------------------- */ class Migration_Add_google_analytics_setting extends CI_Migration { diff --git a/src/application/migrations/004_add_date_format_setting.php b/src/application/migrations/004_add_date_format_setting.php index c014f80f..8c147b65 100644 --- a/src/application/migrations/004_add_date_format_setting.php +++ b/src/application/migrations/004_add_date_format_setting.php @@ -8,7 +8,7 @@ * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 * @link http://easyappointments.org - * @since v1.0.0 + * @since v1.1.0 * ---------------------------------------------------------------------------- */ class Migration_Add_date_format_setting extends CI_Migration { diff --git a/src/application/migrations/005_add_require_captcha_setting.php b/src/application/migrations/005_add_require_captcha_setting.php new file mode 100644 index 00000000..1524896e --- /dev/null +++ b/src/application/migrations/005_add_require_captcha_setting.php @@ -0,0 +1,24 @@ + + * @copyright Copyright (c) 2013 - 2015, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.1.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_require_captcha_setting extends CI_Migration { + public function up() { + $this->load->model('settings_model'); + $this->settings_model->set_setting('require_captcha', '1'); + } + + public function down() { + $this->load->model('settings_model'); + $this->settings_model->remove_setting('require_captcha'); + } +}