Files
mini_tp/database.sql
T
nepiedg 166940d5a6 Initial commit: ThinkPHP refactor (tp)
Made-with: Cursor
2026-04-02 02:13:12 +00:00

24 lines
1.1 KiB
SQL

-- 用户表
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户名',
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
`nickname` varchar(50) DEFAULT '' COMMENT '昵称',
`email` varchar(100) DEFAULT '' COMMENT '邮箱',
`phone` varchar(20) DEFAULT '' COMMENT '手机号',
`avatar` varchar(255) DEFAULT '' COMMENT '头像',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0:禁用 1:启用',
`created_at` int(11) DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) DEFAULT NULL COMMENT '更新时间',
`delete_time` int(11) DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
KEY `email` (`email`),
KEY `phone` (`phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
-- 插入示例数据
INSERT INTO `user` (`username`, `password`, `nickname`, `email`, `status`) VALUES
('demo', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '演示用户', 'demo@example.com', 1);
-- 密码为: password