代码拉取完成,页面将自动刷新
同步操作将从 小海同学/store-server 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* @Description: 建库建表语句
* @Author: hai-27
* @Date: 2020-02-07 16:51:58
* @LastEditors: hai-27
* @LastEditTime: 2020-03-27 15:36:01
*/
create database storeDB;
use storeDB;
create table users(
user_id int primary key auto_increment,
userName char (40) not null unique,
password char (40) not null,
userPhoneNumber char(11) null
);
-- ALTER TABLE users MODIFY COLUMN userName char (40) not null unique;
-- ALTER TABLE users MODIFY COLUMN password char (40) not null;
-- insert into users
-- values(null, 'admin', '123456', '13580018623');
create table carousel(
carousel_id int primary key auto_increment,
imgPath char (50) not null,
describes char (50) not null
);
-- insert into carousel
-- values(null, 'public/imgs/cms_1.jpg', '123456');
-- insert into carousel
-- values(null, 'public/imgs/cms_2.jpg', '123456');
-- insert into carousel
-- values(null, 'public/imgs/cms_3.jpg', '123456');
-- insert into carousel
-- values(null, 'public/imgs/cms_4.jpg', '123456');
create table category(
category_id int primary key auto_increment,
category_name char(20) not null
);
create table product(
product_id int primary key auto_increment,
product_name char (100) not null,
category_id int not null,
product_title char (30) not null,
product_intro text not null,
product_picture char (200),
product_price double not null,
product_selling_price double not null,
product_num int not null,
product_sales int not null,
constraint FK_product_category foreign key (category_id) references category (category_id)
);
create table product_picture(
id int primary key auto_increment,
product_id int not null,
product_picture char (200),
intro text null,
constraint FK_product_id foreign key (product_id) references product (product_id)
);
create table shoppingCart(
id int primary key auto_increment,
user_id int not null,
product_id int not null,
num int not null,
constraint FK_user_id foreign key (user_id) references users (user_id),
constraint FK_shoppingCart_id foreign key (product_id) references product (product_id)
);
create table orders(
id int primary key auto_increment,
order_id bigint not null,
user_id int not null,
product_id int not null,
product_num int not null,
product_price double not null,
order_time bigint not null,
constraint FK_order_user_id foreign key (user_id) references users (user_id),
constraint FK_order_id foreign key (product_id) references product (product_id)
);
create table collect(
id int primary key auto_increment,
user_id int not null,
product_id int not null,
collect_time bigint not null,
constraint FK_collect_user_id foreign key (user_id) references users (user_id),
constraint FK_collect_id foreign key (product_id) references product (product_id)
);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。