"UPDATE settings_current SET selected_value = '{$selectedValue}', category = '{$category}' WHERE variable = '$variable' AND category = '{$category}'"
"UPDATE settings SET selected_value = '{$selectedValue}', category = '{$category}' WHERE variable = '$variable' AND category = '{$category}'"
);
}
}
@ -55,7 +55,7 @@ class Version20230216122900 extends AbstractMigrationChamilo
// Rename setting for hierarchical skill presentation.
$this->addSql(
"UPDATE settings_current SET variable = 'skills_hierarchical_view_in_user_tracking', title = 'skills_hierarchical_view_in_user_tracking' WHERE variable = 'table_of_hierarchical_skill_presentation'"
"UPDATE settings SET variable = 'skills_hierarchical_view_in_user_tracking', title = 'skills_hierarchical_view_in_user_tracking' WHERE variable = 'table_of_hierarchical_skill_presentation'"
);
// Insert extra fields required.
@ -248,13 +248,13 @@ class Version20230216122900 extends AbstractMigrationChamilo
$category = strtolower($category);
$result = $this->connection
->executeQuery(
"SELECT COUNT(1) FROM settings_current WHERE variable = '$variable' AND category = '$category'"
"SELECT COUNT(1) FROM settings WHERE variable = '$variable' AND category = '$category'"
)
;
$count = $result->fetchNumeric()[0];
if (!empty($count)) {
$this->addSql(
"DELETE FROM settings_current WHERE variable = '{$variable}' AND category = '$category'"
"DELETE FROM settings WHERE variable = '{$variable}' AND category = '$category'"
@ -13,61 +13,61 @@ class Version20240423101010 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Clean up settings_current table from settings if those were previously added (during development). Does not affect production environment migrating properly.';
return 'Clean up settings table from settings if those were previously added (during development). Does not affect production environment migrating properly.';
}
public function up(Schema $schema): void
{
if ($schema->hasTable('settings_current')) {
if ($schema->hasTable('settings')) {
// Adding author_id and setting the foreign key
$this->addSql('DELETE FROM settings_current WHERE variable = "announcements_hide_send_to_hrm_users"');
$this->addSql('DELETE FROM settings_current WHERE variable = "display_upcoming_events"');
$this->addSql('DELETE FROM settings_current WHERE variable = "hide_header_footer"');
$this->addSql('DELETE FROM settings_current WHERE variable = "homepage_view"');
$this->addSql('DELETE FROM settings_current WHERE variable = "show_tool_shortcuts"');
$this->addSql('DELETE FROM settings_current WHERE variable = "enable_wami_record"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_personal_user_files"');
$this->addSql('DELETE FROM settings_current WHERE variable = "if_file_exists_option"');
$this->addSql('DELETE FROM settings_current WHERE variable = "math_mimetex"');
$this->addSql('DELETE FROM settings_current WHERE variable = "quiz_question_allow_inter_course_linking"');
$this->addSql('DELETE FROM settings_current WHERE variable = "gradebook_show_percentage_in_reports"');
$this->addSql('DELETE FROM settings_current WHERE variable = "gradebook_enable_best_score"');
$this->addSql('DELETE FROM settings_current WHERE variable = "fixed_encoding"');
$this->addSql('DELETE FROM settings_current WHERE variable = "hosting_total_size_limit"');
$this->addSql('DELETE FROM settings_current WHERE variable = "mail_template_system"');
$this->addSql('DELETE FROM settings_current WHERE variable = "cron_notification_mails"');
$this->addSql('DELETE FROM settings_current WHERE variable = "enable_message_tags"');
$this->addSql('DELETE FROM settings_current WHERE variable = "keep_old_images_after_delete"');
$this->addSql('DELETE FROM settings_current WHERE variable = "theme_fallback"');
$this->addSql('DELETE FROM settings_current WHERE variable = "sync_db_with_schema"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_portfolio_tool"');
$this->addSql('DELETE FROM settings_current WHERE variable = "session_stored_in_db_as_backup"');
$this->addSql('DELETE FROM settings_current WHERE variable = "memcache_server"');
$this->addSql('DELETE FROM settings_current WHERE variable = "session_stored_after_n_times"');
$this->addSql('DELETE FROM settings_current WHERE variable = "default_template"');
$this->addSql('DELETE FROM settings_current WHERE variable = "aspell_bin"');
$this->addSql('DELETE FROM settings_current WHERE variable = "aspell_opts"');
$this->addSql('DELETE FROM settings_current WHERE variable = "aspell_temp_dir"');
$this->addSql('DELETE FROM settings_current WHERE variable = "plugin_settings"');
$this->addSql('DELETE FROM settings_current WHERE variable = "is_editable"');
$this->addSql('DELETE FROM settings_current WHERE variable = "number_of_upcoming_events"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_browser_sniffer"');
$this->addSql('DELETE FROM settings_current WHERE variable = "session_tutor_reports_visibility"');
$this->addSql('DELETE FROM settings_current WHERE variable = "session_page_enabled"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_session_status"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_required_survey_questions"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_survey_availability_datetime"');
$this->addSql('DELETE FROM settings_current WHERE variable = "survey_question_dependency"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_mandatory_survey"');
$this->addSql('DELETE FROM settings_current WHERE variable = "allow_survey_tool_in_lp"');
$this->addSql('DELETE FROM settings_current WHERE variable = "decode_utf8"');
$this->addSql('DELETE FROM settings_current WHERE variable = "admin_chamilo_announcements_disable"');
$this->addSql('DELETE FROM settings WHERE variable = "announcements_hide_send_to_hrm_users"');
$this->addSql('DELETE FROM settings WHERE variable = "display_upcoming_events"');
$this->addSql('DELETE FROM settings WHERE variable = "hide_header_footer"');
$this->addSql('DELETE FROM settings WHERE variable = "homepage_view"');
$this->addSql('DELETE FROM settings WHERE variable = "show_tool_shortcuts"');
$this->addSql('DELETE FROM settings WHERE variable = "enable_wami_record"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_personal_user_files"');
$this->addSql('DELETE FROM settings WHERE variable = "if_file_exists_option"');
$this->addSql('DELETE FROM settings WHERE variable = "math_mimetex"');
$this->addSql('DELETE FROM settings WHERE variable = "quiz_question_allow_inter_course_linking"');
$this->addSql('DELETE FROM settings WHERE variable = "gradebook_show_percentage_in_reports"');
$this->addSql('DELETE FROM settings WHERE variable = "gradebook_enable_best_score"');
$this->addSql('DELETE FROM settings WHERE variable = "fixed_encoding"');
$this->addSql('DELETE FROM settings WHERE variable = "hosting_total_size_limit"');
$this->addSql('DELETE FROM settings WHERE variable = "mail_template_system"');
$this->addSql('DELETE FROM settings WHERE variable = "cron_notification_mails"');
$this->addSql('DELETE FROM settings WHERE variable = "enable_message_tags"');
$this->addSql('DELETE FROM settings WHERE variable = "keep_old_images_after_delete"');
$this->addSql('DELETE FROM settings WHERE variable = "theme_fallback"');
$this->addSql('DELETE FROM settings WHERE variable = "sync_db_with_schema"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_portfolio_tool"');
$this->addSql('DELETE FROM settings WHERE variable = "session_stored_in_db_as_backup"');
$this->addSql('DELETE FROM settings WHERE variable = "memcache_server"');
$this->addSql('DELETE FROM settings WHERE variable = "session_stored_after_n_times"');
$this->addSql('DELETE FROM settings WHERE variable = "default_template"');
$this->addSql('DELETE FROM settings WHERE variable = "aspell_bin"');
$this->addSql('DELETE FROM settings WHERE variable = "aspell_opts"');
$this->addSql('DELETE FROM settings WHERE variable = "aspell_temp_dir"');
$this->addSql('DELETE FROM settings WHERE variable = "plugin_settings"');
$this->addSql('DELETE FROM settings WHERE variable = "is_editable"');
$this->addSql('DELETE FROM settings WHERE variable = "number_of_upcoming_events"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_browser_sniffer"');
$this->addSql('DELETE FROM settings WHERE variable = "session_tutor_reports_visibility"');
$this->addSql('DELETE FROM settings WHERE variable = "session_page_enabled"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_session_status"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_required_survey_questions"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_survey_availability_datetime"');
$this->addSql('DELETE FROM settings WHERE variable = "survey_question_dependency"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_mandatory_survey"');
$this->addSql('DELETE FROM settings WHERE variable = "allow_survey_tool_in_lp"');
$this->addSql('DELETE FROM settings WHERE variable = "decode_utf8"');
$this->addSql('DELETE FROM settings WHERE variable = "admin_chamilo_announcements_disable"');
}
}
public function down(Schema $schema): void
{
if ($schema->hasTable('settings_current')) {
if ($schema->hasTable('settings')) {
// There is no reversion because this is a clean-up of issues fixed later during development