系列二十一、数据库&表初始化

drop database if exists 20231110_shiro;
create database 20231110_shiro;
use 20231110_shiro;

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
                         `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
                         `is_deleted` int NOT NULL DEFAULT 0 COMMENT '删除标识 0:未删除、1:已删除',
                         `create_time` datetime NOT NULL COMMENT '创建时间',
                         `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
                         `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
                         `age` int NULL DEFAULT NULL COMMENT '年龄',
                         `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = DYNAMIC;

你可能感兴趣的:(开发环境系列,数据库)