UpdraftPlus remove original table and not restore backup
-
I have a table that are described in backup file like below:
# Table structure of table wp_sm_aa_article_views
CREATE TABLE wp_sm_aa_article_views (
id bigint unsigned NOT NULL AUTO_INCREMENT,
view_date date NOT NULL DEFAULT (utc_date()),
partner_id bigint unsigned DEFAULT NULL,
channel_id bigint unsigned NOT NULL,
style_id bigint unsigned NOT NULL,
landing_query bigint unsigned DEFAULT NULL,
custom_id bigint unsigned DEFAULT NULL,
search_query bigint unsigned NOT NULL,
terms varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
view_count bigint unsigned DEFAULT '1',
unique_hash varchar(40) COLLATE utf8mb4_unicode_520_ci GENERATED ALWAYS AS (sha(concat(view_date,partner_id,channel_id,style_id,coalesce(landing_query,0),coalesce(custom_id,0),coalesce(search_query,0),coalesce(terms,0)))) STORED,
PRIMARY KEY (id),
UNIQUE KEY unique_view_segment (unique_hash)
) ENGINE=InnoDB AUTO_INCREMENT=6274 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci ;But if I try to restore backup with this table, I’m getting an error:
0014.446 () An error (25) occurred: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MARY KEY (id), UNIQUE KEYunique_view_segment(unique_hash)) ENGINE=InnoD' at line 1 - SQL query was (type=2): CREATE TABLEpg_sm_aa_article_views(idbigint unsigned NOT NULL AUTO_INCREMENT,view_datedate NOT NULL DEFAULT (utc_date()),partner_idbigint unsigned DEFAULT NULL,channel_idbigint unsigned NOT NULL,style_idbigint unsigned NOT NULL,landing_querybigint unsigned DEFAULT NULL,custom_idbigint unsigned DEFAULT NULL,search_querybigint unsigned NOT NULL,termsvarchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,view_countbigint unsigned DEFAULT '1',unique_hashvarchar(40) COLLATE utf8mb4_unicode_520_ci MARY KEY (id), UNIQUE KEYunique_view_segment(unique_hash)) ENGINE=InnoDB AUTO_INCREMENT=6274 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci ;The problem SQL query with is used to restore table:
create tablepg_sm_aa_article_views
(
idbigint unsigned not null auto_increment,
view_datedate not null default (utc_date()),
partner_idbigint unsigned default null,
channel_idbigint unsigned not null,
style_idbigint unsigned not null,
landing_querybigint unsigned default null,
custom_idbigint unsigned default null,
search_querybigint unsigned not null,
termsvarchar(255) collate utf8mb4_unicode_520_ci default null,
view_countbigint unsigned default '1',
unique_hashvarchar(40) collate utf8mb4_unicode_520_ci MARY key (id), # <------ The piece are missed
unique keyunique_view_segment(unique_hash)
) engine = InnoDB
auto_increment = 6274
default charset = utf8mb4
collate = utf8mb4_unicode_520_ci
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘UpdraftPlus remove original table and not restore backup’ is closed to new replies.