-- 数据库初始化
-- 创建数据库
create database if not exists dbking;
-- 切换到dbking数据库
use dbking;
-- 创建用户表
create table user(
u_id int auto_increment primary key,
u_name varchar(8) not null unique,
password varchar(16) not null,
u_sex enum('男','女','未知') default '未知',
u_date timestamp not null default now(),
avatar varchar(52)
);
-- 创建英雄表
create table hero(
h_id int auto_increment primary key,
h_name varchar(10) not null unique,
img varchar(52)
);
-- 创建游戏表
create table game(
g_id int auto_increment primary key,
h_name varchar(10),
start_time timestamp not null default now(),
duration varchar(10) default '00:00',
iswin enum('胜利','失败') default '胜利',
constraint fk_game_hero_name foreign key (h_name) references hero(h_name)
);
-- 创建领域表
create table field(
f_id int auto_increment primary key,
f_name varchar(16) not null unique,
descript varchar(100),
f_tiem timestamp not null default now()
);
-- 创建帖子或动态表
create table post(
p_id int auto_increment primary key,
p_title varchar(50) not null,
u_name varchar(8),
f_name varchar(16) default '动态',
content varchar(200),
p_time timestamp not null default now(),
imgurl varchar(52),
constraint fk_post_user_name foreign key (u_name) references user(u_name),
constraint fk_post_field_name foreign key (f_name) references field(f_name)
);
-- 创建评论表
create table comments(
c_id int auto_increment primary key,
u_name varchar(8),
p_id int,
content varchar(100) not null,
constraint fk_comments_user_name foreign key (u_name) references user(u_name),
constraint fk_comments_post_id foreign key (p_id) references post(p_id)
);
-- 创建访问表
create table visit(
v_id int auto_increment primary key,
u_id int,
p_id int,
v_time timestamp not null default now(),
constraint fk_visit_user_id foreign key (u_id) references user(u_id),
constraint fk_visit_post_id foreign key (p_id) references post(p_id)
);
-- 创建点赞表
create table agree(
a_id int auto_increment primary key,
u_id int,
p_id int,
a_time timestamp not null default now(),
constraint fk_agree_user_id foreign key (u_id) references user(u_id),
constraint fk_agree_post_id foreign key (p_id) references post(p_id)
);
-- 创建关注表
create table concern(
con_id int auto_increment primary key,
u_name varchar(8),
ued_name varchar(8),
con_time timestamp not null default now(),
constraint fk_concern_user_name foreign key (u_name) references user(u_name),
constraint fk_concern_userd_name foreign key (ued_name) references user(u_name)
);
-- 添加基础用户
insert into user(u_name,password) values ('admin','123456'),('大数学家','123456');
-- 添加英雄
insert into hero(h_name) values ('元歌'),('露娜'),('鲁班七号'),('鲁班大师'),('凯'),('安其拉'),('百里守约'),('百里玄策'),('妲己'),('项羽'),('刘备'),('曹操'),('李白'),('韩信'),('菲'),('澜'),('狄仁杰'),('花木兰'),('孙悟空');
-- 添加游戏
insert into game(h_name,duration,iswin) values ('元歌','23:54','胜利'),('露娜','12:23','失败');
-- 添加领域
insert into field(f_name,descript) values ('动态','个人发的动态,创建帖子时领域什么都不选默认就是动态'),('游戏官方','在这里可以发布官方通知,获取最新消息,更新须知');
-- 在这里你可以分享你的游戏攻略,也可以在这里看到别人的游戏攻略
-- 添加帖子
insert into post(p_title,u_name,f_name,content) values('开服通知','admin','游戏官方','好消息!好消息!游戏开服了,开服了。大家可以在这里发帖,看攻略,查数据');
insert into post(p_title,u_name,content) values('动态测试','大数学家','我是动态,我是动态,我是动态,我是动态我是动态,我是动态,我是动态,我是动态,我是动态,我是动态,我是动态,我是动态,');
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
king-app是一个基于Vue开发的王者营地仿制应用,包含835个文件,其中包括352个JavaScript文件、152个Markdown文件、114个JSON文件、26个TypeScript文件、19个Vue文件、15个SVG文件、14个YAML文件、9个ESLint配置文件和7个NPM忽略文件。该项目为用户提供了一个全面、高效的王者营地仿制解决方案,支持多平台浏览,具备良好的用户体验和实用性。
资源推荐
资源详情
资源评论
收起资源包目录
基于Vue的king-app王者营地仿制应用设计源码 (755个子文件)
AUTHORS 42B
mime.cmd 299B
base.css 2KB
main.css 460B
.editorconfig 540B
.editorconfig 286B
.eslintignore 10B
.eslintignore 10B
.eslintrc 1KB
.eslintrc 1022B
.eslintrc 585B
.eslintrc 247B
.eslintrc 231B
.eslintrc 180B
.eslintrc 176B
.eslintrc 172B
.eslintrc 164B
.gitignore 302B
API.html 82KB
index.html 337B
favicon.ico 4KB
iconv-lite.iml 458B
lbt03.jpeg 109KB
lbt02.jpeg 29KB
yuange.jpeg 26KB
luban.jpeg 23KB
luna.jpeg 18KB
lbds.jpg 842KB
bg-bq.jpg 426KB
errors.js 172KB
errors.js 88KB
bignumber.js 84KB
ssl_profiles.js 81KB
ssl_profiles.js 78KB
qs.js 67KB
long.js 38KB
parse.js 34KB
stringify.js 32KB
sbcs-data-generated.js 31KB
sbcs-data-generated.js 31KB
_stream_readable.js 31KB
connection.js 27KB
response.js 27KB
packet.js 24KB
index.js 23KB
dbcs-codec.js 23KB
dbcs-codec.js 21KB
_stream_writable.js 20KB
ipaddr.js 19KB
bignumber.min.js 18KB
index.js 18KB
tests.js 15KB
index.js 15KB
application.js 14KB
promise.js 14KB
Connection.js 14KB
Parser.js 13KB
index.js 12KB
request.js 12KB
index.js 12KB
Protocol.js 11KB
charsets.js 11KB
is-property.js 11KB
index.js 11KB
index.js 10KB
index.js 10KB
query.js 10KB
utf32.js 10KB
stringify.js 10KB
long.js 10KB
ipaddr.min.js 10KB
string_decoder.js 9KB
charsets.js 9KB
dbcs-data.js 9KB
parse.js 9KB
utf7.js 9KB
utf7.js 9KB
index.js 9KB
GetIntrinsic.js 9KB
extend-node.js 8KB
yallist.js 8KB
dbcs-data.js 8KB
seq-queue-test.js 8KB
index.js 8KB
connection_config.js 8KB
_stream_transform.js 8KB
Pool.js 7KB
yallist.js 7KB
values.js 7KB
index.js 7KB
utils.js 7KB
pool_cluster.js 7KB
index.js 7KB
indent-option.js 6KB
index.js 6KB
ConnectionConfig.js 6KB
PoolCluster.js 6KB
client_handshake.js 6KB
index.js 6KB
index.js 6KB
共 755 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
沐知全栈开发
- 粉丝: 4962
- 资源: 4984
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功