mysql.sql 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. -- 后台用户
  2. DROP TABLE IF EXISTS `mall_admin_user`;
  3. CREATE TABLE `mall_admin_user` (
  4. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  5. `username` varchar(100) NOT NULL COMMENT '用户名',
  6. `password` char(32) NOT NULL COMMENT '密码',
  7. `status` tinyint(1) unsigned NOT NULL COMMENT '1正常,0待审,99删除',
  8. `create_time` int(10) unsigned NOT NULL COMMENT '创建时间',
  9. `update_time` int(10) NOT NULL COMMENT '更新时间',
  10. `last_login_time` int(10) NOT NULL COMMENT '最后登录时间',
  11. `last_login_ip` varchar(100) NOT NULL COMMENT '最后登录ip',
  12. `operate_user` varchar(100) NOT NULL COMMENT '操作人',
  13. PRIMARY KEY (`id`),
  14. UNIQUE KEY `username` (`username`) USING BTREE
  15. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  16. -- 前端会员
  17. DROP TABLE IF EXISTS `mall_user`;
  18. CREATE TABLE `mall_user` (
  19. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  20. `username` varchar(100) NOT NULL COMMENT '用户名',
  21. `phone_number` varchar(20) NOT NULL COMMENT '手机号',
  22. `password` char(32) NOT NULL COMMENT '密码',
  23. `ltype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '登录方式 默认0手机号码登录 1用户密码登录',
  24. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '会话保存天数',
  25. `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  26. `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  27. `update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
  28. `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1正常,0待审,99删除',
  29. `operate_user` varchar(100) NOT NULL COMMENT '操作人',
  30. PRIMARY KEY (`id`) USING BTREE,
  31. KEY `username` (`username`),
  32. KEY `phone_number` (`phone_number`)
  33. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  34. -- 商品分类
  35. DROP TABLE IF EXISTS `mall_category`;
  36. CREATE TABLE `mall_category` (
  37. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  38. `name` varchar(255) NOT NULL COMMENT '分类名称',
  39. `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父类ID',
  40. `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标',
  41. `path` varchar(255) NOT NULL DEFAULT '' COMMENT '路径1,2,5',
  42. `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  43. `update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
  44. `operate_user` varchar(100) NOT NULL COMMENT '操作人',
  45. `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '',
  46. `listorder` int(10) unsigned unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  47. PRIMARY KEY (`id`) USING BTREE,
  48. KEY `pid` (`pid`),
  49. KEY `name` (`name`)
  50. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;