From b873fc92eee188f450866cec99411020d45a9e94 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 21 Jul 2016 20:30:02 +0200 Subject: [PATCH] Added attendants number field in services page (#109). --- src/application/config/migration.php | 2 +- .../008_add_service_attendants_number.php | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/application/migrations/008_add_service_attendants_number.php diff --git a/src/application/config/migration.php b/src/application/config/migration.php index 4c5404de..7d25f4ec 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'] = 7; // current +$config['migration_version'] = 8; // current /* diff --git a/src/application/migrations/008_add_service_attendants_number.php b/src/application/migrations/008_add_service_attendants_number.php new file mode 100644 index 00000000..323f32f4 --- /dev/null +++ b/src/application/migrations/008_add_service_attendants_number.php @@ -0,0 +1,37 @@ + + * @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_service_attendants_number extends CI_Migration { + public function up() { + $this->load->dbforge(); + + $fields = [ + 'attendants_number' => [ + 'type' => 'INT', + 'constraint' => '11', + 'default' => '1', + 'null' => true, + 'after' => 'availabilities_type' + ] + ]; + + $this->dbforge->add_column('ea_services', $fields); + + $this->db->update('ea_services', ['attendants_number' => '1']); + } + + public function down() { + $this->load->dbforge(); + $this->dbforge->drop_column('ea_services', 'attendants_number'); + } +}