From 31673436fe32ab0ceed8ff97bb128409f8db6169 Mon Sep 17 00:00:00 2001 From: alext Date: Sat, 8 Jun 2019 15:56:38 +0200 Subject: [PATCH] Added location field in the database for appointments. --- src/application/config/migration.php | 2 +- src/application/migrations/013_location.php | 30 +++++++++++++++++++++ src/assets/sql/data.sql | 2 +- src/assets/sql/structure.sql | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src/application/migrations/013_location.php diff --git a/src/application/config/migration.php b/src/application/config/migration.php index 9f9804dd..5f8c03eb 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'] = 12; // current +$config['migration_version'] = 13; // current /* diff --git a/src/application/migrations/013_location.php b/src/application/migrations/013_location.php new file mode 100644 index 00000000..270bba7d --- /dev/null +++ b/src/application/migrations/013_location.php @@ -0,0 +1,30 @@ + + * @copyright Copyright (c) 2013 - 2018, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_location extends CI_Migration { + public function up() + { + $this->db->query(' + ALTER TABLE `ea_appointments` + ADD COLUMN `location` TEXT AFTER `end_datetime`; + '); + } + + public function down() + { + $this->db->query(' + ALTER TABLE `ea_appointments` + DROP COLUMN `location` TEXT AFTER `end_datetime`; + '); + } +} diff --git a/src/assets/sql/data.sql b/src/assets/sql/data.sql index e6fca50c..f5c4a93d 100644 --- a/src/assets/sql/data.sql +++ b/src/assets/sql/data.sql @@ -24,4 +24,4 @@ VALUES ('display_privacy_policy', '0'), ('privacy_policy_content', 'Privacy policy content.'); -INSERT INTO `ea_migrations` VALUES ('12'); +INSERT INTO `ea_migrations` VALUES ('13'); diff --git a/src/assets/sql/structure.sql b/src/assets/sql/structure.sql index 01a73465..b481a72b 100644 --- a/src/assets/sql/structure.sql +++ b/src/assets/sql/structure.sql @@ -6,6 +6,7 @@ CREATE TABLE IF NOT EXISTS `ea_appointments` ( `book_datetime` DATETIME, `start_datetime` DATETIME, `end_datetime` DATETIME, + `location` TEXT, `notes` TEXT, `hash` TEXT, `is_unavailable` TINYINT(4) DEFAULT '0',