亚马逊电商数据自动化管理接口平台开发SQL设计
重要说明
- 本文章为亚马逊系列其中的一篇,具体详见 主页 中亚马逊分类
- 该系列项目均为【CSDN轻夏】原创,未经允许禁止转载
- 如有疑问请添加qq群聊302493982学习咨询
文章目录
1、店铺权限
authorized_shops.sql
# SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `authorized_shops`;
CREATE TABLE `authorized_shops`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`organization_id` int NULL DEFAULT NULL,
`shop_id` int NULL DEFAULT NULL,
`shop_rename` varchar(255) DEFAULT NULL,
`amazon_name` varchar(255) DEFAULT NULL,
`authorized_time` date DEFAULT NULL,
`account_area` varchar(255) DEFAULT NULL,
`account_second_area` varchar(255) DEFAULT NULL,
`merchant_id` varchar(255) DEFAULT NULL,
`authorized_id` varchar(255) DEFAULT NULL,
INDEX (`organization_id`) USING BTREE,
CONSTRAINT `authorized_shops_fk`
FOREIGN KEY (`organization_id`) REFERENCES `organization` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
# SET FOREIGN_KEY_CHECKS = 1;
2、订单信息
buy.sql
DROP TABLE IF EXISTS `buy`;
CREATE TABLE `buy`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`order_id` int DEFAULT -1,
`upload_id` int DEFAULT -1,
`product_id` int DEFAULT -1,
`buy_number` DECIMAL(10, 2) DEFAULT NULL,
`buy_time` date DEFAULT NULL,
`firm_name` varchar(255) DEFAULT NULL,
`photo` varchar(255) DEFAULT NULL,
`amazon_id` varchar(255) DEFAULT NULL,
`buy_money` DECIMAL(10, 2) DEFAULT NULL,
`amazon_profit` DECIMAL(10, 2) DEFAULT NULL,
`get_money` DECIMAL(10, 2) DEFAULT NULL,
`now_day_exchange_rate` DECIMAL(10, 2) DEFAULT NULL,
`purchase_price` DECIMAL(10, 2) DEFAULT NULL,
`national_transport_money` DECIMAL(10, 2) DEFAULT NULL,
`international_transport_money` DECIMAL(10, 2) DEFAULT NULL,
`international_transport_money_correct` DECIMAL(10, 2) DEFAULT NULL,
`international_transport_money_freeze` DECIMAL(10, 2) DEFAULT NULL,
`platform_money` DECIMAL(10, 2) DEFAULT NULL,
`packing_charge` DECIMAL(10, 2) DEFAULT NULL,
`return_money` DECIMAL(10, 2) DEFAULT NULL,
`profit` DECIMAL(10, 2) DEFAULT NULL,
`buy_status` varchar(255) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
`status` tinyint(1) DEFAULT 0
);
# SET FOREIGN_KEY_CHECKS = 1;
3、运输费用
cost_freight.sql
# SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `cost_freight`;
CREATE TABLE `cost_freight`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`product_id` int NULL DEFAULT NULL,
`buy_price` DECIMAL(10, 2) DEFAULT NULL,
`inland_price` DECIMAL(10, 2) DEFAULT NULL,
`outland_price` DECIMAL(10, 2) DEFAULT NULL,
`repertory_count` int DEFAULT NULL,
`package_size_l` DECIMAL(10, 2) DEFAULT NULL,
`package_size_w` DECIMAL(10, 2) DEFAULT NULL,
`package_size_h` DECIMAL(10, 2) DEFAULT NULL,
`package_weight` DECIMAL(10, 2) DEFAULT NULL,
`profit_rate` DECIMAL(10, 2) DEFAULT NULL,
`up_people` int DEFAULT NULL,
`enable` tinyint(1) default 0,
`time` date,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `cost_freight_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
# SET FOREIGN_KEY_CHECKS = 1;
4、费用细则
drop table if exists china_cost_rate;
create table china_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `china_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists america_cost_rate;
create table america_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `america_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists canada_cost_rate;
create table canada_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `canada_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists brazil_cost_rate;
create table brazil_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `brazil_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists mexico_cost_rate;
create table mexico_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `mexico_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists england_cost_rate;
create table england_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `england_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists germany_cost_rate;
create table germany_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `germany_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists france_cost_rate;
create table france_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `france_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists spain_cost_rate;
create table spain_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `spain_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists italy_cost_rate;
create table italy_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `italy_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists netherlands_cost_rate;
create table netherlands_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `netherlands_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists japanese_cost_rate;
create table japanese_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `japanese_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists india_cost_rate;
create table india_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `india_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists australian_cost_rate;
create table australian_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `australian_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists sweden_cost_rate;
create table sweden_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `sweden_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists poland_cost_rate;
create table poland_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `poland_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists arab_cost_rate;
create table arab_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `arab_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists saudi_cost_rate;
create table saudi_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `saudi_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists singapore_cost_rate;
create table singapore_cost_rate
(
`inner_id` int not null primary key AUTO_INCREMENT,
`cost_freight_id` int,
`freight_cost` DECIMAL(10, 2) null,
`selling_cost` DECIMAL(10, 2) null,
`foreign_cost` DECIMAL(10, 2) null,
`optimize` DECIMAL(10, 2) null,
`final_price` DECIMAL(10, 2) null,
`profit` DECIMAL(10, 2) null,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `singapore_cost_rate_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `cost_freight` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
5、介绍细则
introduce_detial.sql
drop table if exists china_introduce;
create table china_introduce
(
`inner_id` int not null primary key AUTO_INCREMENT,
`product_id` int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `china_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists america_introduce;
create table america_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `america_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists canada_introduce;
create table canada_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `canada_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists brazil_introduce;
create table brazil_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `brazil_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists mexico_introduce;
create table mexico_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `mexico_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists england_introduce;
create table england_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `england_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists germany_introduce;
create table germany_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `germany_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists france_introduce;
create table france_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `france_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists spain_introduce;
create table spain_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `spain_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists italy_introduce;
create table italy_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `italy_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists netherlands_introduce;
create table netherlands_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `netherlands_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists japanese_introduce;
create table japanese_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `japanese_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists india_introduce;
create table india_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `india_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists australian_introduce;
create table australian_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `australian_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists sweden_introduce;
create table sweden_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `sweden_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists poland_introduce;
create table poland_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `poland_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists arab_introduce;
create table arab_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `arab_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists saudi_introduce;
create table saudi_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `saudi_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
drop table if exists singapore_introduce;
create table singapore_introduce
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int,
`title` varchar(500) null,
`five_describe` varchar(500) null,
`detail_describe` varchar(500) null,
`key` varchar(500) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `singapore_introduce_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
6、物流信息
logistics_information.sql
DROP TABLE IF EXISTS `logistics_information`;
CREATE TABLE `logistics_information`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`buy_id` int DEFAULT -1,
`recipients` varchar(255) DEFAULT NULL,
`tel` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`country_china` varchar(255) DEFAULT NULL,
`zip_code` varchar(255) DEFAULT NULL,
`state` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`street` varchar(255) DEFAULT NULL,
`detial` varchar(255) DEFAULT NULL,
`number` int DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`englishName` varchar(255) DEFAULT NULL,
`weight` DECIMAL(10, 2) DEFAULT NULL,
`long` DECIMAL(10, 2) DEFAULT NULL,
`wide` DECIMAL(10, 2) DEFAULT NULL,
`high` DECIMAL(10, 2) DEFAULT NULL,
`logistics_kind` varchar(255) DEFAULT NULL,
`logistics_second_kind` varchar(255) DEFAULT NULL,
`ioss` varchar(255) DEFAULT NULL,
`transport_number` varchar(255) DEFAULT NULL,
`tracking_number` varchar(255) DEFAULT NULL,
`international_transport_number` varchar(255) DEFAULT NULL,
`international_tracking_number` varchar(255) DEFAULT NULL,
`international_money` DECIMAL(10, 2) DEFAULT NULL,
`route` varchar(255) DEFAULT NULL,
`deliver_time` date DEFAULT NULL,
`logistics_time` date DEFAULT NULL,
`deliver_status` varchar(255) DEFAULT NULL,
`synchronization_status` varchar(255) DEFAULT NULL,
`enable` tinyint(1) default 0,
INDEX (`buy_id`) USING BTREE,
CONSTRAINT `logistics_information_fk`
FOREIGN KEY (`buy_id`) REFERENCES `buy` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
# SET FOREIGN_KEY_CHECKS = 1;
7、组织架构
organization.sql
# SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `organization`;
CREATE TABLE `organization`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`name` int DEFAULT NULL,
`user_name` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`organization_kind` varchar(255) DEFAULT NULL,
`organization_name` varchar(255) DEFAULT NULL,
`up_organization` int DEFAULT NULL,
`sku_prefix` varchar(255) DEFAULT NULL,
`contact` varchar(255) DEFAULT NULL,
`phone_number` varchar(255) DEFAULT NULL,
`last_money` varchar(255) DEFAULT NULL,
`is_look` tinyint(1) DEFAULT 0,
`is_delete` tinyint(1) DEFAULT 0,
`enable` int DEFAULT NULL,
`time` date
);
# SET FOREIGN_KEY_CHECKS = 1;
8、图片组
photo_group.sql
drop table if exists photo_group;
create table photo_group
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`product_id` int DEFAULT NULL,
`photo_name` varchar(255) DEFAULT NULL,
`photo_path` varchar(255) DEFAULT NULL,
`enable` tinyint(1) default 0,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `photo_group_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
9、图片变体
photo_variant.sql
drop table if exists photo_variant;
create table photo_variant
(
inner_id int not null primary key AUTO_INCREMENT,
variant_group_id int null,
photo_name varchar(255) null,
photo_path varchar(255) null,
INDEX (`variant_group_id`) USING BTREE,
CONSTRAINT `photo_variant_fk`
FOREIGN KEY (`variant_group_id`) REFERENCES `variant_group` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
10、产品
product.sql
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`cost_freight_id` int DEFAULT NULL,
`product_number` varchar(255) DEFAULT NULL,
`product_name` varchar(255) DEFAULT NULL,
`product_kind` varchar(255) DEFAULT NULL,
`product_inner_kind` varchar(255) DEFAULT NULL,
`load_status` varchar(255) DEFAULT NULL,
`product_code` varchar(255) DEFAULT NULL,
`up_people` int DEFAULT NULL,
`enable` tinyint(1) default 0,
`time` date,
INDEX (`cost_freight_id`) USING BTREE,
CONSTRAINT `product_fk`
FOREIGN KEY (`cost_freight_id`) REFERENCES `organization` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
SET FOREIGN_KEY_CHECKS = 1;
11、产品信息
product_info.sql
drop table if exists product_info;
create table product_info
(
`inner_id` int not null primary key AUTO_INCREMENT,
`product_id` int null,
`firm_name` varchar(255) DEFAULT NULL,
`brand_name` varchar(255) DEFAULT NULL,
`firm_id` varchar(255) DEFAULT NULL,
`product_from` varchar(255) DEFAULT NULL,
`inner_sku` varchar(255) DEFAULT NULL,
`correction_sku` varchar(255) DEFAULT NULL,
`web_path` varchar(255) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `product_info_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
12、数据上传
upload.sql
DROP TABLE IF EXISTS `upload`;
CREATE TABLE `upload`
(
`inner_id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,
`authorized_shops_id` int DEFAULT -1,
`operate_people_id` int DEFAULT NULL,
`product_id` int DEFAULT -1,
`amazon_classify_type` varchar(255) DEFAULT NULL,
`classify_id` varchar(255) DEFAULT NULL,
`classify_type` varchar(255) DEFAULT NULL,
`update_time` date DEFAULT NULL,
`load_status` varchar(255) DEFAULT NULL,
`fail_reason` varchar(500) DEFAULT NULL,
INDEX (`operate_people_id`) USING BTREE,
CONSTRAINT `upload_operate_people_id_fk`
FOREIGN KEY (`operate_people_id`) REFERENCES `organization` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE,
INDEX (`authorized_shops_id`) USING BTREE,
CONSTRAINT `upload_authorized_shops_id_fk`
FOREIGN KEY (`authorized_shops_id`) REFERENCES `authorized_shops` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);
# SET FOREIGN_KEY_CHECKS = 1;
13、变体组
variant_group.sql
drop table if exists variant_group;
create table variant_group
(
inner_id int not null primary key AUTO_INCREMENT,
product_id int null,
variant_name varchar(255) null,
variant_sku varchar(255) null,
variant_add_money DECIMAL(10, 2) null,
inventory int null,
variant_total_money DECIMAL(10, 2) null,
variant_upc_ean varchar(255) null,
asin varchar(255) null,
INDEX (`product_id`) USING BTREE,
CONSTRAINT `variant_group_fk`
FOREIGN KEY (`product_id`) REFERENCES `product` (`inner_id`)
ON DELETE CASCADE ON UPDATE CASCADE
);