add-sql-file
This commit is contained in:
+189
@@ -0,0 +1,189 @@
|
||||
-- ----------------------------
|
||||
-- Title:管理员表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_admin
|
||||
-- ---------------------------
|
||||
-- other_json:{"cate_id":[1,27], "city_id":["350200", "350500"], "platfrom_id":[0, 1], "app_id":[1,2]}
|
||||
-- cate_id:可操作行业,city_id:可操作城市,platfrom_id:可登录平台,app_id:可操作应用
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_admin;
|
||||
create table lc_sys_admin(
|
||||
id int unsigned not null auto_increment comment '管理id',
|
||||
username varchar(32) not null comment '管理员名称',
|
||||
mobile varchar(11) not null default '' comment '手机号码',
|
||||
password varchar(255) not null comment '用户密码',
|
||||
role_id int unsigned not null default 0 comment '角色id',
|
||||
other_json text not null default '' comment '行业、城市归属 json格式 {cate_id: [1,2]}',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
c_time int unsigned not null default 0 comment '创建时间',
|
||||
u_time timestamp not null default current_timestamp on update current_timestamp,
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='管理员表';
|
||||
alter table lc_sys_admin add login_ip varchar(16) not null default '' comment '最近登录ip' after status;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:管理日志表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_admin_log
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_admin_log;
|
||||
create table lc_sys_admin_log(
|
||||
id int unsigned not null auto_increment comment 'id',
|
||||
admin_id int unsigned not null comment '管理员id',
|
||||
username varchar(32) not null comment '管理员名称',
|
||||
target_id int unsigned not null default 0 comment '对象id',
|
||||
descrip varchar(255) not null comment '操作描述',
|
||||
action varchar(32) not null comment '操作节点',
|
||||
ip varchar(32) not null default '' comment 'ip',
|
||||
jsondata text not null default '' comment '更多数据',
|
||||
u_time timestamp not null default current_timestamp on update current_timestamp,
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='管理日志表';
|
||||
create index idx_admin_id on lc_sys_admin_log(admin_id);
|
||||
create index idx_action on lc_sys_admin_log(action);
|
||||
alter table lc_sys_admin_log add type varchar(16) not null default '' comment '特殊日志类型 如jjd';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:区域表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_area
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_area;
|
||||
create table lc_sys_area(
|
||||
id int unsigned not null auto_increment comment 'id',
|
||||
name varchar(32) not null comment '商圈/路段 名称',
|
||||
province_id int unsigned not null comment '省id',
|
||||
province_name varchar(32) not null comment '省名称',
|
||||
city_id int unsigned not null comment '城市id',
|
||||
city_name varchar(32) not null comment '城市名称',
|
||||
county_id int unsigned not null comment '区id',
|
||||
county_name varchar(32) not null comment '区名称',
|
||||
type tinyint(1) unsigned not null default 0 comment '类型 1:商圈|2:路段|3:卖场',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='区域表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:行业分类表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_category
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_category;
|
||||
create table lc_sys_category(
|
||||
id int unsigned not null auto_increment comment 'id',
|
||||
pid int unsigned not null default 0 comment '父id',
|
||||
name varchar(32) not null comment '行业分类名称',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='行业分类表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:开通城市表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_city
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_city;
|
||||
create table lc_sys_city(
|
||||
id int unsigned not null auto_increment comment 'id',
|
||||
city_id int unsigned not null comment '城市id',
|
||||
name varchar(32) not null default '' comment '城市名称',
|
||||
firstchar varchar(2) not null default '' comment '城市首字母',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='开通城市表';
|
||||
|
||||
|
||||
drop table if exists lc_sys_config;
|
||||
create table lc_sys_config(
|
||||
id int unsigned not null auto_increment comment '自增id',
|
||||
k varchar(32) not null comment '配置key',
|
||||
v text not null default '' comment '配置',
|
||||
c_time int unsigned not null default 0 comment '创建时间',
|
||||
u_time timestamp not null default current_timestamp on update current_timestamp,
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='系统配置表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:系统菜单表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_menu
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_menu;
|
||||
create table lc_sys_menu(
|
||||
id int unsigned not null auto_increment comment '自增id',
|
||||
pid int unsigned not null default 0 comment '父id',
|
||||
name varchar(32) not null comment '菜单名称',
|
||||
icon varchar(128) not null default '' comment '菜单图标',
|
||||
node varchar(128) not null default '' comment '节点',
|
||||
url varchar(128) not null default '' comment '链接',
|
||||
sort int unsigned not null default 0 comment '排序',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='系统菜单表';
|
||||
alter table lc_sys_menu add outer_link tinyint(1) not null default 0 comment '是否为外链' after url;
|
||||
alter table lc_sys_menu add column type tinyint(1) unsigned not null default 0 comment '类型(0总后台 1商家后台)';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:系统角色表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_role
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_role;
|
||||
create table lc_sys_role(
|
||||
id int unsigned not null auto_increment comment '角色id',
|
||||
name varchar(32) not null comment '角色名称',
|
||||
menu_ids text not null default '' comment '菜单id 都会隔开',
|
||||
action_json text not null default '' comment '操作权限 json格式 {菜单id: [1,2]}',
|
||||
descrip varchar(255) not null default '' comment '角色描述',
|
||||
status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用',
|
||||
primary key(id)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='系统角色表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:标签表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_tag
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_tag;
|
||||
create table lc_sys_tag(
|
||||
id int unsigned not null auto_increment comment '自增id',
|
||||
tag_name varchar(128) not null comment '标签名称',
|
||||
primary key(id),
|
||||
unique key (tag_name)
|
||||
)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='标签表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:系统内容标签表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_content_tags
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_content_tags;
|
||||
create table lc_sys_content_tags (
|
||||
id int(10) unsigned not null auto_increment comment '自增id',
|
||||
cate_id int(10) unsigned not null comment '一级分类id',
|
||||
cate2_id int(10) unsigned not null comment '二级分类id',
|
||||
tag_id int(10) unsigned not null comment '标签id',
|
||||
status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,1正常',
|
||||
primary key (id)
|
||||
) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='系统内容标签表'
|
||||
|
||||
-- ----------------------------
|
||||
-- Title:系统内容标签表
|
||||
-- Author:0fun
|
||||
-- Table:lc_sys_tag_category
|
||||
-- ---------------------------
|
||||
drop table if exists lc_sys_tag_category;
|
||||
create table lc_sys_tag_category (
|
||||
id int(10) unsigned not null auto_increment comment '自增id',
|
||||
pid int(10) unsigned not null default '0' comment '父id',
|
||||
name varchar(32) not null default '' comment '分类名称',
|
||||
status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,1正常',
|
||||
primary key (id)
|
||||
) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='系统标签分类表'
|
||||
Reference in New Issue
Block a user