diff --git a/src/application/migrations/012_legal_contents.php b/src/application/migrations/012_legal_contents.php new file mode 100644 index 00000000..204cbb12 --- /dev/null +++ b/src/application/migrations/012_legal_contents.php @@ -0,0 +1,53 @@ + + * @copyright Copyright (c) 2013 - 2018, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.3.2 + * ---------------------------------------------------------------------------- */ + +class Migration_Legal_contents extends CI_Migration { + public function up() + { + $this->db->insert('ea_settings', ['name' => 'display_cookie_notice', 'value' => '0']); + $this->db->insert('ea_settings', ['name' => 'cookie_notice_content', 'value' => 'Cookie notice content.']); + $this->db->insert('ea_settings', ['name' => 'display_terms_and_conditions', 'value' => '0']); + $this->db->insert('ea_settings', + ['name' => 'terms_and_conditions_content', 'value' => 'Terms and conditions content.']); + $this->db->insert('ea_settings', ['name' => 'display_privacy_policy', 'value' => '0']); + $this->db->insert('ea_settings', ['name' => 'privacy_policy_content', 'value' => 'Privacy policy content.']); + + $this->db->query(' + CREATE TABLE IF NOT EXISTS `ea_consents` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `created` DATETIME DEFAULT CURRENT_TIMESTAMP, + `modified` DATETIME DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP, + `first_name` VARCHAR(256), + `last_name` VARCHAR(256), + `email` VARCHAR(512), + `ip` VARCHAR(256), + PRIMARY KEY (`id`) + ) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; + '); + } + + public function down() + { + $this->db->delete('ea_settings', ['name' => 'display_cookie_notice']); + $this->db->delete('ea_settings', ['name' => 'cookie_notice_content']); + $this->db->delete('ea_settings', ['name' => 'display_terms_and_conditions']); + $this->db->delete('ea_settings', ['name' => 'terms_and_conditions_content']); + $this->db->delete('ea_settings', ['name' => 'display_privacy_policy']); + $this->db->delete('ea_settings', ['name' => 'privacy_policy_content']); + + $this->db->query('DROP TABLE `ea_consents`;'); + } +} diff --git a/src/assets/sql/data.sql b/src/assets/sql/data.sql index 430ce465..e6fca50c 100644 --- a/src/assets/sql/data.sql +++ b/src/assets/sql/data.sql @@ -16,6 +16,12 @@ VALUES ('customer_notifications', '1'), ('date_format', 'DMY'), ('time_format', 'regular'), - ('require_captcha', '0'); + ('require_captcha', '0'), + ('display_cookie_notice', '0'), + ('cookie_notice_content', 'Cookie notice content.'), + ('display_terms_and_conditions', '0'), + ('terms_and_conditions_content', 'Terms and conditions content.'), + ('display_privacy_policy', '0'), + ('privacy_policy_content', 'Privacy policy content.'); -INSERT INTO `ea_migrations` VALUES ('11'); +INSERT INTO `ea_migrations` VALUES ('12'); diff --git a/src/assets/sql/structure.sql b/src/assets/sql/structure.sql index 78ccf943..fde705a4 100644 --- a/src/assets/sql/structure.sql +++ b/src/assets/sql/structure.sql @@ -21,6 +21,19 @@ CREATE TABLE IF NOT EXISTS `ea_appointments` ( ENGINE = InnoDB DEFAULT CHARSET = utf8; +CREATE TABLE IF NOT EXISTS `ea_consents` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `created` DATETIME DEFAULT CURRENT_TIMESTAMP, + `modified` DATETIME DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP, + `first_name` VARCHAR(256), + `last_name` VARCHAR(256), + `email` VARCHAR(512), + `ip` VARCHAR(256), + PRIMARY KEY (`id`) +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; CREATE TABLE `ea_migrations` ( `version` INT(11) NOT NULL