2020-04-22 22:48:56 +03:00
|
|
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
2018-06-24 14:17:04 +03:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Easy!Appointments - Open Source Web Scheduler
|
|
|
|
*
|
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2020-03-11 12:10:59 +03:00
|
|
|
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
2018-06-24 14:17:04 +03:00
|
|
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
|
|
* @link http://easyappointments.org
|
|
|
|
* @since v1.3.2
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
2020-04-22 22:48:56 +03:00
|
|
|
/**
|
|
|
|
* Class Migration_Legal_contents
|
|
|
|
*
|
|
|
|
* @property CI_Loader load
|
|
|
|
* @property CI_DB_query_builder db
|
|
|
|
* @property CI_DB_forge dbforge
|
|
|
|
* @property Settings_Model settings_model
|
|
|
|
*/
|
2018-06-24 14:17:04 +03:00
|
|
|
class Migration_Legal_contents extends CI_Migration {
|
2020-04-22 22:48:56 +03:00
|
|
|
/**
|
|
|
|
* Upgrade method.
|
|
|
|
*/
|
2018-06-24 14:17:04 +03:00
|
|
|
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,
|
2018-07-10 16:51:42 +03:00
|
|
|
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
2018-06-24 14:17:04 +03:00
|
|
|
ON UPDATE CURRENT_TIMESTAMP,
|
2018-07-10 16:51:42 +03:00
|
|
|
`created` TIMESTAMP,
|
2018-06-24 14:17:04 +03:00
|
|
|
`first_name` VARCHAR(256),
|
|
|
|
`last_name` VARCHAR(256),
|
|
|
|
`email` VARCHAR(512),
|
|
|
|
`ip` VARCHAR(256),
|
2018-06-24 18:12:13 +03:00
|
|
|
`type` VARCHAR(256),
|
2018-06-24 14:17:04 +03:00
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
)
|
|
|
|
ENGINE = InnoDB
|
|
|
|
DEFAULT CHARSET = utf8;
|
|
|
|
');
|
|
|
|
}
|
|
|
|
|
2020-04-22 22:48:56 +03:00
|
|
|
/**
|
|
|
|
* Downgrade method.
|
|
|
|
*/
|
2018-06-24 14:17:04 +03:00
|
|
|
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`;');
|
|
|
|
}
|
|
|
|
}
|