smile-picture-backend/sql/create_table.sql
2025-03-03 13:30:47 +08:00

24 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 创建库
create database if not exists `smile-picture`;
-- 使用库
use `smile-picture`;
-- 用户表
create table if not exists user
(
id bigint auto_increment comment 'id' primary key,
user_account varchar(256) not null comment '账号',
user_password varchar(512) not null comment '密码',
user_name varchar(256) null comment '用户昵称',
user_avatar varchar(1024) null comment '用户头像',
user_profile varchar(512) null comment '用户简介',
user_role varchar(256) default 'user' not null comment '用户角色user/admin',
edit_time datetime default CURRENT_TIMESTAMP not null comment '编辑时间',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
is_delete tinyint default 0 not null comment '是否删除',
UNIQUE KEY uk_userAccount (user_account),
INDEX idx_userName (user_name)
) comment '用户' collate = utf8mb4_unicode_ci;