Skip to content

Commit

Permalink
fixed ALter Table query issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairraeen committed Nov 25, 2024
1 parent 7e07c8f commit c5e225e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions php/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ function qsm_add_author_column_in_db() {
$success = false;
$mlwQuizMasterNext->log_manager->add( 'Error updating column charset utf8mb4_unicode_ci', "Tried $query but got {$wpdb->last_error}.", 0, 'error' );
}
}

if ( $success ) {
update_option( 'qsm_update_db_column_charset_utf8mb4_unicode_ci', 1 );
}
}
Expand Down
8 changes: 1 addition & 7 deletions php/classes/class-qsm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1966,12 +1966,6 @@ public function update() {
$results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
}

// Update 2.6.1
$results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_qm_audit_trail CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' );
$results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_questions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
$results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_quizzes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
$results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_results CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );

global $wpdb;
$table_name = $wpdb->prefix . 'mlw_results';
$audit_table = $wpdb->prefix . 'mlw_qm_audit_trail';
Expand Down Expand Up @@ -2038,7 +2032,7 @@ public function update() {
}

update_option( 'mlw_quiz_master_version', $data );

// Update 9.1.3
$mlw_questions_table = $wpdb->prefix . 'mlw_questions';
if ( 'linked_question' != $wpdb->get_var( "SHOW COLUMNS FROM $mlw_questions_table LIKE 'linked_question'" ) ) {
Expand Down

0 comments on commit c5e225e

Please sign in to comment.