mall.sql 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 127.0.0.1
  4. Source Server Type : MySQL
  5. Source Server Version : 80026
  6. Source Host : localhost:3306
  7. Source Schema : ruoyi-vue-pro
  8. Target Server Type : MySQL
  9. Target Server Version : 80026
  10. File Encoding : 65001
  11. Date: 05/02/2022 00:50:30
  12. */
  13. SET
  14. FOREIGN_KEY_CHECKS = 0;
  15. SET NAMES utf8mb4;
  16. -- ----------------------------
  17. -- Table structure for product_category
  18. -- ----------------------------
  19. DROP TABLE IF EXISTS `product_category`;
  20. CREATE TABLE `product_category`
  21. (
  22. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类编号',
  23. `pid` bigint NOT NULL COMMENT '父分类编号',
  24. `name` varchar(255) NOT NULL COMMENT '分类名称',
  25. `icon` varchar(100) NOT NULL DEFAULT '#' COMMENT '分类图标',
  26. `banner_url` varchar(255) NOT NULL COMMENT '分类图片',
  27. `sort` int DEFAULT '0' COMMENT '分类排序',
  28. `description` varchar(1024) DEFAULT NULL COMMENT '分类描述',
  29. `status` tinyint NOT NULL COMMENT '开启状态',
  30. `creator` varchar(64) DEFAULT '' COMMENT '创建者',
  31. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  32. `updater` varchar(64) DEFAULT '' COMMENT '更新者',
  33. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  34. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  35. `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
  36. PRIMARY KEY (`id`) USING BTREE
  37. ) ENGINE=InnoDB COMMENT='商品分类';
  38. -- ----------------------------
  39. -- Table structure for product_brand
  40. -- ----------------------------
  41. DROP TABLE IF EXISTS `product_brand`;
  42. CREATE TABLE `product_brand`
  43. (
  44. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '品牌编号',
  45. `category_id` bigint NOT NULL COMMENT '分类编号',
  46. `name` varchar(255) NOT NULL COMMENT '品牌名称',
  47. `banner_url` varchar(255) NOT NULL COMMENT '品牌图片',
  48. `sort` int DEFAULT '0' COMMENT '品牌排序',
  49. `description` varchar(1024) DEFAULT NULL COMMENT '品牌描述',
  50. `status` tinyint NOT NULL COMMENT '状态',
  51. `creator` varchar(64) DEFAULT '' COMMENT '创建者',
  52. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  53. `updater` varchar(64) DEFAULT '' COMMENT '更新者',
  54. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  55. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  56. `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
  57. PRIMARY KEY (`id`) USING BTREE
  58. ) ENGINE=InnoDB COMMENT='品牌';
  59. -- TODO 父级菜单的 id 处理
  60. INSERT INTO `system_menu` (`id`, `name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES (2000, '商城', '', 1, 1, 0, '/mall', 'merchant', NULL, 0);
  61. INSERT INTO `system_menu` (`id`, `name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES (2001, '商品管理', '', 1, 1, 2000, 'product', 'dict', NULL, 0);
  62. -- 商品分类 菜单 SQL
  63. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类管理', '', 2, 0, 2001, 'category', '', 'mall/product/category/index', 0);
  64. -- 按钮父菜单ID
  65. SELECT @parentId := LAST_INSERT_ID();
  66. -- 按钮 SQL
  67. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类查询', 'product:category:query', 3, 1, @parentId, '', '', '', 0);
  68. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类创建', 'product:category:create', 3, 2, @parentId, '', '', '', 0);
  69. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类更新', 'product:category:update', 3, 3, @parentId, '', '', '', 0);
  70. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类删除', 'product:category:delete', 3, 4, @parentId, '', '', '', 0);
  71. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('商品分类导出', 'product:category:export', 3, 5, @parentId, '', '', '', 0);
  72. -- 品牌管理 菜单 SQL
  73. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌管理', '', 2, 0, 2001, 'brand', '', 'mall/product/brand/index', 0);
  74. -- 按钮父菜单ID
  75. SELECT @parentId := LAST_INSERT_ID();
  76. -- 按钮 SQL
  77. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌查询', 'product:brand:query', 3, 1, @parentId, '', '', '', 0);
  78. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌创建', 'product:brand:create', 3, 2, @parentId, '', '', '', 0);
  79. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌更新', 'product:brand:update', 3, 3, @parentId, '', '', '', 0);
  80. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌删除', 'product:brand:delete', 3, 4, @parentId, '', '', '', 0);
  81. INSERT INTO `system_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) VALUES ('品牌导出', 'product:brand:export', 3, 5, @parentId, '', '', '', 0);