forked from mirrors/easyappointments
Perform various DB migration fixes and improvements
This commit is contained in:
parent
efc532664a
commit
0564ded317
21 changed files with 254 additions and 180 deletions
|
@ -17,10 +17,13 @@ class Migration_Add_time_format_setting extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'time_format',
|
||||
'value' => 'regular'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'time_format'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'time_format',
|
||||
'value' => 'regular'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +31,9 @@ class Migration_Add_time_format_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'time_format']);
|
||||
if ($this->db->get_where('settings', ['name' => 'time_format'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'time_format']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,80 +17,102 @@ class Migration_Legal_contents extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_cookie_notice',
|
||||
'value' => '0'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_cookie_notice',
|
||||
'value' => '0'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'cookie_notice_content',
|
||||
'value' => 'Cookie notice content.'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'cookie_notice_content'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'cookie_notice_content',
|
||||
'value' => 'Cookie notice content.'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_terms_and_conditions',
|
||||
'value' => '0'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_terms_and_conditions'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_terms_and_conditions',
|
||||
'value' => '0'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'terms_and_conditions_content',
|
||||
'value' => 'Terms and conditions content.'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'terms_and_conditions_content'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'terms_and_conditions_content',
|
||||
'value' => 'Terms and conditions content.'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_privacy_policy',
|
||||
'value' => '0'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_privacy_policy'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_privacy_policy',
|
||||
'value' => '0'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'privacy_policy_content',
|
||||
'value' => 'Privacy policy content.'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'privacy_policy_content'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'privacy_policy_content',
|
||||
'value' => 'Privacy policy content.'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->dbforge->add_field([
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'auto_increment' => TRUE
|
||||
],
|
||||
'created' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => TRUE
|
||||
],
|
||||
'modified' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => TRUE
|
||||
],
|
||||
'first_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'last_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'email' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '512',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'ip' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'type' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->dbforge->add_key('id', TRUE);
|
||||
if ( ! $this->db->table_exists('consents'))
|
||||
{
|
||||
$this->dbforge->add_field([
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'auto_increment' => TRUE
|
||||
],
|
||||
'created' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => TRUE
|
||||
],
|
||||
'modified' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => TRUE
|
||||
],
|
||||
'first_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'last_name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'email' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '512',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'ip' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'type' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '256',
|
||||
'null' => TRUE,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->dbforge->create_table('consents', TRUE, ['engine' => 'InnoDB']);
|
||||
$this->dbforge->add_key('id', TRUE);
|
||||
|
||||
$this->dbforge->create_table('consents', TRUE, ['engine' => 'InnoDB']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,30 +120,51 @@ class Migration_Legal_contents extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_cookie_notice'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_cookie_notice'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'cookie_notice_content'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'cookie_notice_content'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'cookie_notice_content'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_terms_and_conditions'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'display_terms_and_conditions'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_terms_and_conditions'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'terms_and_conditions_content'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'terms_and_conditions_content'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'terms_and_conditions_content'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_privacy_policy'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'display_privacy_policy'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_privacy_policy'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'privacy_policy_content'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'privacy_policy_content'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'privacy_policy_content'
|
||||
]);
|
||||
}
|
||||
|
||||
$this->dbforge->drop_table('consents');
|
||||
if ($this->db->table_exists('consents'))
|
||||
{
|
||||
$this->dbforge->drop_table('consents');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,10 +17,13 @@ class Migration_Add_weekday_start_setting extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'first_weekday',
|
||||
'value' => 'sunday'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'first_weekday'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'first_weekday',
|
||||
'value' => 'sunday'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +31,9 @@ class Migration_Add_weekday_start_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'first_weekday']);
|
||||
if ($this->db->get_where('settings', ['name' => 'first_weekday'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'first_weekday']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,15 +17,31 @@ class Migration_Create_appointment_location_column extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('appointments') . '`
|
||||
ADD COLUMN `location` TEXT AFTER `end_datetime`;
|
||||
');
|
||||
if ( ! $this->db->field_exists('location', 'appointments'))
|
||||
{
|
||||
$fields = [
|
||||
'location' => [
|
||||
'type' => 'TEXT',
|
||||
'null' => TRUE,
|
||||
'after' => 'end_datetime'
|
||||
]
|
||||
];
|
||||
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
ADD COLUMN `location` TEXT AFTER `description`;
|
||||
');
|
||||
$this->dbforge->add_column('appointments', $fields);
|
||||
}
|
||||
|
||||
if ( ! $this->db->field_exists('location', 'services'))
|
||||
{
|
||||
$fields = [
|
||||
'location' => [
|
||||
'type' => 'TEXT',
|
||||
'null' => TRUE,
|
||||
'after' => 'description'
|
||||
]
|
||||
];
|
||||
|
||||
$this->dbforge->add_column('services', $fields);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,14 +49,14 @@ class Migration_Create_appointment_location_column extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('appointments') . '`
|
||||
DROP COLUMN `location`;
|
||||
');
|
||||
if ($this->db->field_exists('location', 'appointments'))
|
||||
{
|
||||
$this->dbforge->drop_column('appointments', 'location');
|
||||
}
|
||||
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
DROP COLUMN `location`;
|
||||
');
|
||||
if ($this->db->field_exists('location', 'services'))
|
||||
{
|
||||
$this->dbforge->drop_column('services', 'location');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class Migration_Add_working_plan_exceptions_to_user_settings extends EA_Migratio
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->field_exists('working_plan_exceptions', 'user_settings'))
|
||||
if ($this->db->field_exists('working_plan_exceptions', 'user_settings'))
|
||||
{
|
||||
$this->dbforge->drop_column('user_settings', 'working_plan_exceptions');
|
||||
}
|
||||
|
|
|
@ -17,10 +17,13 @@ class Migration_Add_require_phone_number_setting extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'require_phone_number',
|
||||
'value' => '1'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'require_phone_number'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'require_phone_number',
|
||||
'value' => '1'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +31,9 @@ class Migration_Add_require_phone_number_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'require_phone_number']);
|
||||
if ($this->db->get_where('settings', ['name' => 'require_phone_number'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'require_phone_number']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,10 +19,14 @@ class Migration_Add_api_token_setting extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'api_token',
|
||||
'value' => ''
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'api_token'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'api_token',
|
||||
'value' => ''
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,6 +36,9 @@ class Migration_Add_api_token_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'api_token']);
|
||||
if ($this->db->get_where('settings', ['name' => 'api_token'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'api_token']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,10 +17,13 @@ class Migration_Add_display_any_provider_setting extends EA_Migration {
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_any_provider',
|
||||
'value' => '1'
|
||||
]);
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_any_provider'])->num_rows())
|
||||
{
|
||||
$this->db->insert('settings', [
|
||||
'name' => 'display_any_provider',
|
||||
'value' => '1'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,8 +31,9 @@ class Migration_Add_display_any_provider_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_any_provider'
|
||||
]);
|
||||
if ($this->db->get_where('settings', ['name' => 'display_any_provider'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', ['name' => 'display_any_provider']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,9 +63,7 @@ class Migration_Add_booking_field_settings extends EA_Migration {
|
|||
|
||||
if ($this->db->get_where('settings', ['name' => $setting_name])->num_rows())
|
||||
{
|
||||
$setting = $this->db->get_where('settings', [
|
||||
'name' => $setting_name,
|
||||
])->row_array();
|
||||
$setting = $this->db->get_where('settings', ['name' => $setting_name])->row_array();
|
||||
|
||||
$value = $setting['value']; // Use existing value.
|
||||
|
||||
|
@ -96,9 +94,7 @@ class Migration_Add_booking_field_settings extends EA_Migration {
|
|||
|
||||
if ($this->db->get_where('settings', ['name' => $setting_name])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => $setting_name,
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => $setting_name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,10 +31,12 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA
|
|||
|
||||
$this->dbforge->modify_column('services', $fields);
|
||||
|
||||
$this->db->query('ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
ADD CONSTRAINT `services_categories` FOREIGN KEY (`id_categories`) REFERENCES `' . $this->db->dbprefix('categories') . '` (`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE');
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
ADD CONSTRAINT `services_categories` FOREIGN KEY (`id_categories`) REFERENCES `' . $this->db->dbprefix('categories') . '` (`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE
|
||||
');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,10 +59,12 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA
|
|||
|
||||
$this->dbforge->modify_column('services', $fields);
|
||||
|
||||
$this->db->query('ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
ADD CONSTRAINT `services_service_categories` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('categories') . '` (`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE');
|
||||
$this->db->query('
|
||||
ALTER TABLE `' . $this->db->dbprefix('services') . '`
|
||||
ADD CONSTRAINT `services_service_categories` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('categories') . '` (`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE CASCADE
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
class Migration_Add_color_column_to_services_table extends CI_Migration {
|
||||
class Migration_Add_color_column_to_services_table extends EA_Migration {
|
||||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
class Migration_Add_color_column_to_appointments_table extends CI_Migration {
|
||||
class Migration_Add_color_column_to_appointments_table extends EA_Migration {
|
||||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_matomo_analytics_url_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'matomo_analytics_url'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'matomo_analytics_url'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'matomo_analytics_url',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'matomo_analytics_url']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_display_delete_personal_information_setting extends EA_Migra
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_delete_personal_information',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'display_delete_personal_information']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_disable_booking_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'disable_booking',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'disable_booking']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_disable_booking_message_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'disable_booking_message',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'disable_booking_message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_company_logo_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'company_logo'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'company_logo'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'company_logo',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'company_logo']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_company_color_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'company_color'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'company_color'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'company_color',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'company_color']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,9 @@ class Migration_Add_display_login_button_setting extends EA_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows())
|
||||
if ($this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows())
|
||||
{
|
||||
$this->db->delete('settings', [
|
||||
'name' => 'display_login_button',
|
||||
]);
|
||||
$this->db->delete('settings', ['name' => 'display_login_button']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
class Migration_Add_is_private_column_to_services_table extends CI_Migration {
|
||||
class Migration_Add_is_private_column_to_services_table extends EA_Migration {
|
||||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
|
@ -37,7 +37,7 @@ class Migration_Add_is_private_column_to_services_table extends CI_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->field_exists('is_private', 'services'))
|
||||
if ($this->db->field_exists('is_private', 'services'))
|
||||
{
|
||||
$this->dbforge->drop_column('services', 'is_private');
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
class Migration_Add_is_private_column_to_users_table extends CI_Migration {
|
||||
class Migration_Add_is_private_column_to_users_table extends EA_Migration {
|
||||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
|
@ -37,7 +37,7 @@ class Migration_Add_is_private_column_to_users_table extends CI_Migration {
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
if ( ! $this->db->field_exists('is_private', 'users'))
|
||||
if ($this->db->field_exists('is_private', 'users'))
|
||||
{
|
||||
$this->dbforge->drop_column('users', 'is_private');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue