diff --git a/application/migrations/010_add_time_format_setting.php b/application/migrations/010_add_time_format_setting.php index 199e9f45..917a097e 100644 --- a/application/migrations/010_add_time_format_setting.php +++ b/application/migrations/010_add_time_format_setting.php @@ -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']); + } } } diff --git a/application/migrations/012_legal_contents.php b/application/migrations/012_legal_contents.php index 78aa29af..70118254 100644 --- a/application/migrations/012_legal_contents.php +++ b/application/migrations/012_legal_contents.php @@ -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'); + } } } diff --git a/application/migrations/013_add_weekday_start_setting.php b/application/migrations/013_add_weekday_start_setting.php index bfef1c51..58fb94c0 100644 --- a/application/migrations/013_add_weekday_start_setting.php +++ b/application/migrations/013_add_weekday_start_setting.php @@ -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']); + } } } diff --git a/application/migrations/014_create_appointment_location_column.php b/application/migrations/014_create_appointment_location_column.php index 7da4e922..83b64139 100644 --- a/application/migrations/014_create_appointment_location_column.php +++ b/application/migrations/014_create_appointment_location_column.php @@ -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'); + } } } diff --git a/application/migrations/015_add_working_plan_exceptions_to_user_settings.php b/application/migrations/015_add_working_plan_exceptions_to_user_settings.php index b18947d5..2f9253fc 100644 --- a/application/migrations/015_add_working_plan_exceptions_to_user_settings.php +++ b/application/migrations/015_add_working_plan_exceptions_to_user_settings.php @@ -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'); } diff --git a/application/migrations/016_add_require_phone_number_setting.php b/application/migrations/016_add_require_phone_number_setting.php index dfed5116..9f031945 100644 --- a/application/migrations/016_add_require_phone_number_setting.php +++ b/application/migrations/016_add_require_phone_number_setting.php @@ -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']); + } } } diff --git a/application/migrations/017_add_api_token_setting.php b/application/migrations/017_add_api_token_setting.php index 775fadc1..afb22561 100644 --- a/application/migrations/017_add_api_token_setting.php +++ b/application/migrations/017_add_api_token_setting.php @@ -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']); + } } } diff --git a/application/migrations/019_add_display_any_provider_setting.php b/application/migrations/019_add_display_any_provider_setting.php index e5341c21..a39d5128 100644 --- a/application/migrations/019_add_display_any_provider_setting.php +++ b/application/migrations/019_add_display_any_provider_setting.php @@ -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']); + } } } diff --git a/application/migrations/022_add_booking_field_settings.php b/application/migrations/022_add_booking_field_settings.php index d8ba86ac..03fe5e2c 100644 --- a/application/migrations/022_add_booking_field_settings.php +++ b/application/migrations/022_add_booking_field_settings.php @@ -63,13 +63,11 @@ 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. - - $this->db->delete('settings', ['name' => $setting_name]); + + $this->db->delete('settings', ['name' => $setting_name]); } if ( ! $this->db->get_where('settings', ['name' => $setting_name])->num_rows()) @@ -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]); } } } diff --git a/application/migrations/024_rename_id_service_categories_column_of_services_table.php b/application/migrations/024_rename_id_service_categories_column_of_services_table.php index 630ff198..5ba005aa 100644 --- a/application/migrations/024_rename_id_service_categories_column_of_services_table.php +++ b/application/migrations/024_rename_id_service_categories_column_of_services_table.php @@ -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 + '); } } } diff --git a/application/migrations/026_add_color_column_to_services_table.php b/application/migrations/026_add_color_column_to_services_table.php index bc0e8149..ff577740 100644 --- a/application/migrations/026_add_color_column_to_services_table.php +++ b/application/migrations/026_add_color_column_to_services_table.php @@ -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. */ diff --git a/application/migrations/027_add_color_column_to_appointments_table.php b/application/migrations/027_add_color_column_to_appointments_table.php index b798a4f7..0618c375 100644 --- a/application/migrations/027_add_color_column_to_appointments_table.php +++ b/application/migrations/027_add_color_column_to_appointments_table.php @@ -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. */ diff --git a/application/migrations/028_add_matomo_analytics_url_setting.php b/application/migrations/028_add_matomo_analytics_url_setting.php index 9fa3ed07..aa31e1b3 100644 --- a/application/migrations/028_add_matomo_analytics_url_setting.php +++ b/application/migrations/028_add_matomo_analytics_url_setting.php @@ -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']); } } } diff --git a/application/migrations/029_add_display_delete_personal_information_setting.php b/application/migrations/029_add_display_delete_personal_information_setting.php index 7092c19c..2d9df622 100644 --- a/application/migrations/029_add_display_delete_personal_information_setting.php +++ b/application/migrations/029_add_display_delete_personal_information_setting.php @@ -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']); } } } diff --git a/application/migrations/030_add_disable_booking_setting.php b/application/migrations/030_add_disable_booking_setting.php index 47c46606..d1253d31 100644 --- a/application/migrations/030_add_disable_booking_setting.php +++ b/application/migrations/030_add_disable_booking_setting.php @@ -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']); } } } diff --git a/application/migrations/031_add_disable_booking_message_setting.php b/application/migrations/031_add_disable_booking_message_setting.php index 61df3eb0..adf82c77 100644 --- a/application/migrations/031_add_disable_booking_message_setting.php +++ b/application/migrations/031_add_disable_booking_message_setting.php @@ -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']); } } } diff --git a/application/migrations/032_add_company_logo_setting.php b/application/migrations/032_add_company_logo_setting.php index 37a6c49a..06e73e7b 100644 --- a/application/migrations/032_add_company_logo_setting.php +++ b/application/migrations/032_add_company_logo_setting.php @@ -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']); } } } diff --git a/application/migrations/033_add_company_color_setting.php b/application/migrations/033_add_company_color_setting.php index 584e12ba..4264d86f 100644 --- a/application/migrations/033_add_company_color_setting.php +++ b/application/migrations/033_add_company_color_setting.php @@ -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']); } } } diff --git a/application/migrations/034_add_display_login_button_setting.php b/application/migrations/034_add_display_login_button_setting.php index 90aaded8..60b35ce2 100644 --- a/application/migrations/034_add_display_login_button_setting.php +++ b/application/migrations/034_add_display_login_button_setting.php @@ -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']); } } } diff --git a/application/migrations/035_add_is_private_column_to_services_table.php b/application/migrations/035_add_is_private_column_to_services_table.php index 2a8663ad..f4329c9c 100644 --- a/application/migrations/035_add_is_private_column_to_services_table.php +++ b/application/migrations/035_add_is_private_column_to_services_table.php @@ -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'); } diff --git a/application/migrations/036_add_is_private_column_to_users_table.php b/application/migrations/036_add_is_private_column_to_users_table.php index 6bf245ea..3d2df4dc 100644 --- a/application/migrations/036_add_is_private_column_to_users_table.php +++ b/application/migrations/036_add_is_private_column_to_users_table.php @@ -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'); }