From ab787526a98cdf110fe1abc25729d58bb9e2bf9c Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Thu, 27 Aug 2020 15:58:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/go-fly-data.sql | 2 -- config/go-fly.sql | 29 +++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 config/go-fly-data.sql diff --git a/config/go-fly-data.sql b/config/go-fly-data.sql deleted file mode 100644 index e3d3fef..0000000 --- a/config/go-fly-data.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `user` (`id`, `name`, `password`, `nickname`, `created_at`, `updated_at`, `deleted_at`, `avator`) VALUES -(null, 'kefu2', '202cb962ac59075b964b07152d234b70', '小白菜', '2020-06-28 03:32:41', '2020-06-28 03:32:41', NULL, 'https://www.wolive.cc/assets/upload/3.jpg'); \ No newline at end of file diff --git a/config/go-fly.sql b/config/go-fly.sql index 308134a..82a3eb1 100644 --- a/config/go-fly.sql +++ b/config/go-fly.sql @@ -8,7 +8,8 @@ CREATE TABLE `user` ( `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `deleted_at` timestamp NULL DEFAULT NULL, `avator` varchar(100) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `idx_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE `user`; INSERT INTO `user` (`id`, `name`, `password`, `nickname`, `created_at`, `updated_at`, `deleted_at`, `avator`) VALUES @@ -48,7 +49,7 @@ CREATE TABLE `message` ( PRIMARY KEY (`id`), KEY `kefu_id` (`kefu_id`), KEY `visitor_id` (`visitor_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `user_role`; CREATE TABLE `user_role` ( @@ -56,14 +57,24 @@ CREATE TABLE `user_role` ( `user_id` int(11) NOT NULL DEFAULT '0', `role_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `user_role` (`id`, `user_id`, `role_id`) VALUES +(1, 1, 1), +(2, 2, 2), +(3, 3, 1); DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 + `id` int(11) NOT NULL, + `name` varchar(100) NOT NULL DEFAULT '', + `method` varchar(100) NOT NULL DEFAULT '', + `path` varchar(2048) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `role` (`id`, `name`, `method`, `path`) VALUES +(1, '普通客服', 'GET,POST', '/kefuinfo,/kefulist'), +(2, '管理员', '*', '*'); + + DROP TABLE IF EXISTS `welcome`; CREATE TABLE `welcome` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -73,4 +84,6 @@ CREATE TABLE `welcome` ( `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `welcome` (`id`, `user_id`, `content`, `is_default`, `ctime`) VALUES +(1, 'kefu2', '本客服代码开源,欢迎star,开源地址:https://github.com/taoshihan1991/go-fly', 1, '2020-08-24 02:57:49'); \ No newline at end of file