上架需求增加
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
CREATE TABLE IF NOT EXISTS biz_publish_file (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT 'primary key',
|
||||
task_id BIGINT NOT NULL COMMENT 'biz_file_task.id',
|
||||
file_key VARCHAR(255) NOT NULL COMMENT 'uploaded temporary file key',
|
||||
source_filename VARCHAR(255) NOT NULL COMMENT 'original source filename',
|
||||
relative_path VARCHAR(1000) NULL COMMENT 'relative upload path',
|
||||
shop_name VARCHAR(255) NOT NULL COMMENT 'shop name resolved from filename',
|
||||
matched TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'whether the shop matched the Ziniao index',
|
||||
shop_id VARCHAR(128) NULL COMMENT 'Ziniao shop id',
|
||||
matched_user_id BIGINT NULL COMMENT 'user id owning the matched Ziniao shop',
|
||||
platform VARCHAR(128) NULL COMMENT 'shop platform',
|
||||
company_name VARCHAR(255) NULL COMMENT 'Ziniao company name',
|
||||
match_status VARCHAR(32) NULL COMMENT 'MATCHED/PENDING/CONFLICT/INDEX_STALE',
|
||||
match_message VARCHAR(1000) NULL COMMENT 'shop match detail',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'PENDING' COMMENT 'PENDING/RUNNING/SUCCESS/FAILED',
|
||||
total_rows INT NOT NULL DEFAULT 0 COMMENT 'current full row count',
|
||||
processed_rows INT NOT NULL DEFAULT 0 COMMENT 'reported processed row count',
|
||||
error_message VARCHAR(1000) NULL COMMENT 'parse or processing error',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'updated time',
|
||||
finished_at DATETIME NULL COMMENT 'finished time',
|
||||
UNIQUE KEY uk_publish_task_file_key (task_id, file_key),
|
||||
KEY idx_publish_file_task_status (task_id, status),
|
||||
KEY idx_publish_file_task_id (task_id, id)
|
||||
) COMMENT='publish task source file';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS biz_publish_item (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT 'primary key',
|
||||
task_id BIGINT NOT NULL COMMENT 'biz_file_task.id',
|
||||
file_id BIGINT NOT NULL COMMENT 'biz_publish_file.id',
|
||||
row_index INT NOT NULL COMMENT 'row order starting from 1',
|
||||
source_id VARCHAR(128) NULL COMMENT 'source id column',
|
||||
asin VARCHAR(128) NULL COMMENT 'ASIN column',
|
||||
country VARCHAR(128) NULL COMMENT 'country column',
|
||||
brand VARCHAR(255) NULL COMMENT 'brand column',
|
||||
price_value VARCHAR(128) NULL COMMENT 'price column formatted value',
|
||||
status_value VARCHAR(128) NULL COMMENT 'status column',
|
||||
sync_status VARCHAR(128) NULL COMMENT 'sync status column',
|
||||
sync_countries VARCHAR(1000) NULL COMMENT 'sync countries column',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'updated time',
|
||||
UNIQUE KEY uk_publish_file_row (file_id, row_index),
|
||||
KEY idx_publish_item_task_file (task_id, file_id, row_index),
|
||||
KEY idx_publish_item_file_country (file_id, country, row_index)
|
||||
) COMMENT='publish task full workbook row';
|
||||
|
||||
INSERT INTO `columns` (`name`, `column_key`, `menu_type`, `route_path`, `sort_order`)
|
||||
SELECT '上架', 'publish', 'app', 'publish', 112
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM `columns` WHERE `column_key` = 'publish'
|
||||
);
|
||||
|
||||
UPDATE `columns`
|
||||
SET `name` = '上架',
|
||||
`menu_type` = 'app',
|
||||
`route_path` = 'publish',
|
||||
`sort_order` = 112
|
||||
WHERE `column_key` = 'publish';
|
||||
Reference in New Issue
Block a user