You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sub_db/sql/ddl.sql

25 lines
1001 B
MySQL

2 years ago
# 第一次执行
create database my_db;
use my_db;
# 用户表
create table user
(
id bigint auto_increment comment 'id' primary key,
username varchar(256) null comment '用户昵称',
userAccount varchar(256) null comment '账号',
avatarUrl varchar(1024) null comment '用户头像',
gender tinyint null comment '性别',
userPassword varchar(512) not null comment '密码',
phone varchar(128) null comment '电话',
email varchar(512) null comment '邮箱',
userStatus int default 0 not null comment '状态 0 - 正常',
createTime datetime default CURRENT_TIMESTAMP comment '创建时间',
updateTime datetime default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
isDelete tinyint default 0 not null comment '是否删除',
userRole int default 0 not null comment '用户角色 0 - 普通用户 1 - 管理员'
) comment '用户';