forked from real-jacket/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
21 lines (17 loc) · 1.15 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CREATE DATABASE `micro_book_mall` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin */;
USE micro_book_mall;
CREATE TABLE `user`
(
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(10) unsigned DEFAULT NULL COMMENT '用户id',
`user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名',
`pwd` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码',
`created_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updated_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`),
UNIQUE KEY `user_user_name_uindex` (`user_name`),
UNIQUE KEY `user_user_id_uindex` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_bin COMMENT ='用户表';
INSERT INTO user (user_id, user_name, pwd) VALUE (10001, 'micro', '1234');