smallchill
6 years ago
13 changed files with 143 additions and 46 deletions
@ -0,0 +1,76 @@
|
||||
/* |
||||
Navicat Premium Data Transfer |
||||
|
||||
Source Server : mysql_localhost |
||||
Source Server Type : MySQL |
||||
Source Server Version : 50723 |
||||
Source Host : localhost:3306 |
||||
Source Schema : bladex_boot |
||||
|
||||
Target Server Type : MySQL |
||||
Target Server Version : 50723 |
||||
File Encoding : 65001 |
||||
|
||||
Date: 20/06/2019 00:31:21 |
||||
*/ |
||||
|
||||
SET NAMES utf8mb4; |
||||
SET FOREIGN_KEY_CHECKS = 0; |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for blade_data_scope |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `blade_data_scope`; |
||||
CREATE TABLE `blade_data_scope` ( |
||||
`id` bigint(64) NOT NULL COMMENT '主键', |
||||
`resource_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源编号', |
||||
`scope_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据权限名称', |
||||
`scope_column` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据权限字段', |
||||
`scope_type` int(2) NULL DEFAULT NULL COMMENT '数据权限类型', |
||||
`scope_value` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据权限值域', |
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据权限备注', |
||||
`create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', |
||||
`update_user` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', |
||||
`status` int(2) NULL DEFAULT NULL COMMENT '状态', |
||||
`is_deleted` int(2) NULL DEFAULT NULL COMMENT '是否已删除', |
||||
PRIMARY KEY (`id`) USING BTREE |
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci; |
||||
|
||||
-- ---------------------------- |
||||
-- Table structure for blade_role_scope |
||||
-- ---------------------------- |
||||
DROP TABLE IF EXISTS `blade_role_scope`; |
||||
CREATE TABLE `blade_role_scope` ( |
||||
`id` bigint(64) NOT NULL COMMENT '主键', |
||||
`scope_id` bigint(64) NULL DEFAULT NULL COMMENT '数据权限id', |
||||
`role_id` bigint(64) NULL DEFAULT NULL COMMENT '角色id', |
||||
PRIMARY KEY (`id`) USING BTREE |
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci; |
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1; |
||||
|
||||
-- ---------------------------- |
||||
-- 部门表增加字段 |
||||
-- ---------------------------- |
||||
ALTER TABLE `blade_dept` |
||||
ADD COLUMN `ancestors` varchar(2000) NULL COMMENT '祖级列表' AFTER `parent_id`, |
||||
ADD COLUMN `dept_category` int(2) NULL COMMENT '部门类型' AFTER `ancestors`; |
||||
|
||||
UPDATE `blade_dept` SET `tenant_id` = '000000', `parent_id` = 0, `ancestors` = '0', `dept_category` = 1, `dept_name` = '刀锋科技', `full_name` = '江苏刀锋科技有限公司', `sort` = 1, `remark` = NULL, `is_deleted` = 0 WHERE `id` = 1123598813738675201; |
||||
UPDATE `blade_dept` SET `tenant_id` = '000000', `parent_id` = 1123598813738675201, `ancestors` = '0,1123598813738675201', `dept_category` = 1, `dept_name` = '常州刀锋', `full_name` = '常州刀锋科技有限公司', `sort` = 1, `remark` = NULL, `is_deleted` = 0 WHERE `id` = 1123598813738675202; |
||||
UPDATE `blade_dept` SET `tenant_id` = '000000', `parent_id` = 1123598813738675201, `ancestors` = '0,1123598813738675201', `dept_category` = 1, `dept_name` = '苏州刀锋', `full_name` = '苏州刀锋科技有限公司', `sort` = 1, `remark` = NULL, `is_deleted` = 0 WHERE `id` = 1123598813738675203; |
||||
|
||||
-- ---------------------------- |
||||
-- 增加字典项 |
||||
-- ---------------------------- |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675227, 0, 'org_category', -1, '机构类型', 7, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675228, 1123598814738675227, 'org_category', 1, '公司', 1, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675229, 1123598814738675227, 'org_category', 2, '部门', 2, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675230, 0, 'scope_type', -1, '数据权限类别', 8, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675231, 1123598814738675230, 'scope_type', 1, '全部可见', 1, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675232, 1123598814738675230, 'scope_type', 2, '本人可见', 2, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675233, 1123598814738675230, 'scope_type', 3, '所在机构可见', 3, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675234, 1123598814738675230, 'scope_type', 4, '所在机构及子级可见', 4, NULL, 0); |
||||
INSERT INTO `blade_dict`(`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_deleted`) VALUES (1123598814738675235, 1123598814738675230, 'scope_type', 5, '自定义', 5, NULL, 0); |
@ -1,26 +0,0 @@
|
||||
ALTER TABLE `blade_dept` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_log_api` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_log_error` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_log_usual` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_notice` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_oss` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_role` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_tenant` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
||||
|
||||
ALTER TABLE `blade_user` |
||||
CHANGE COLUMN `tenant_code` `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID' AFTER `id`; |
Loading…
Reference in new issue