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
(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 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 table
pg_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 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)
- You must be logged in to reply to this topic.