From 31c45c9fdb45a976fe1f5ce95c849b9a4eca3e5a Mon Sep 17 00:00:00 2001 From: zhaoxiang Date: Mon, 13 May 2019 16:10:14 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=81=E7=A7=BB=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/20190425073802_admin_app.php | 19 +++- .../20190425094427_admin_app_group.php | 12 +++ .../20190508070533_admin_auth_group.php | 12 ++- ...20190508100337_admin_auth_group_access.php | 13 ++- .../20190508101122_admin_auth_rule.php | 13 ++- .../20190508152801_admin_fields.php | 19 +++- .../migrations/20190508153800_admin_group.php | 17 +++- .../migrations/20190513065521_admin_list.php | 94 +++++++++++++++++++ .../migrations/20190513070628_admin_menu.php | 84 +++++++++++++++++ 9 files changed, 277 insertions(+), 6 deletions(-) create mode 100644 database/migrations/20190513065521_admin_list.php create mode 100644 database/migrations/20190513070628_admin_menu.php diff --git a/database/migrations/20190425073802_admin_app.php b/database/migrations/20190425073802_admin_app.php index e775c5b..e973a63 100644 --- a/database/migrations/20190425073802_admin_app.php +++ b/database/migrations/20190425073802_admin_app.php @@ -24,6 +24,23 @@ class AdminApp extends Migrator { * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ + + /** + * CREATE TABLE `admin_app` ( + * `id` int(11) unsigned NOT NULL, + * `app_id` varchar(50) NOT NULL DEFAULT '' COMMENT '应用id', + * `app_secret` varchar(50) NOT NULL DEFAULT '' COMMENT '应用密码', + * `app_name` varchar(50) NOT NULL DEFAULT '' COMMENT '应用名称', + * `app_status` int(2) NOT NULL DEFAULT '1' COMMENT '应用状态:0表示禁用,1表示启用', + * `app_info` text COMMENT '应用说明', + * `app_api` text COMMENT '当前应用允许请求的全部API接口', + * `app_group` varchar(128) NOT NULL DEFAULT 'default' COMMENT '当前应用所属的应用组唯一标识', + * `app_addTime` int(11) NOT NULL DEFAULT '0' COMMENT '应用创建时间', + * `app_api_show` text COMMENT '前台样式显示所需数据格式', + * PRIMARY KEY (`id`), + * UNIQUE KEY `app_id` (`app_id`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='appId和appSecret表'; + */ public function change() { $table = $this->table('admin_app', [ 'comment' => 'appId和appSecret表' @@ -54,7 +71,7 @@ class AdminApp extends Migrator { 'limit' => 128, 'default' => 'default', 'comment' => '当前应用所属的应用组唯一标识' - ])->addColumn('app_addTime', 'integer', [ + ])->addColumn('app_add_time', 'integer', [ 'limit' => 11, 'default' => 0, 'comment' => '应用创建时间' diff --git a/database/migrations/20190425094427_admin_app_group.php b/database/migrations/20190425094427_admin_app_group.php index 11c5074..26b9f09 100644 --- a/database/migrations/20190425094427_admin_app_group.php +++ b/database/migrations/20190425094427_admin_app_group.php @@ -24,6 +24,18 @@ class AdminAppGroup extends Migrator { * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ + + /** + * CREATE TABLE `admin_app_group` ( + * `id` int(11) unsigned NOT NULL, + * `name` varchar(128) NOT NULL DEFAULT '' COMMENT '组名称', + * `description` text COMMENT '组说明', + * `status` int(2) NOT NULL DEFAULT '1' COMMENT '组状态:0表示禁用,1表示启用', + * `hash` varchar(128) NOT NULL DEFAULT '' COMMENT '组标识', + * PRIMARY KEY (`id`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用组,目前只做管理使用,没有实际权限控制'; + */ + public function change() { $table = $this->table('admin_app_group', [ 'comment' => '应用组,目前只做管理使用,没有实际权限控制' diff --git a/database/migrations/20190508070533_admin_auth_group.php b/database/migrations/20190508070533_admin_auth_group.php index 8598c6f..a6da548 100644 --- a/database/migrations/20190508070533_admin_auth_group.php +++ b/database/migrations/20190508070533_admin_auth_group.php @@ -1,7 +1,6 @@ table('admin_auth_group', [ 'comment' => '权限组' diff --git a/database/migrations/20190508100337_admin_auth_group_access.php b/database/migrations/20190508100337_admin_auth_group_access.php index 10036c6..b11227d 100644 --- a/database/migrations/20190508100337_admin_auth_group_access.php +++ b/database/migrations/20190508100337_admin_auth_group_access.php @@ -1,7 +1,6 @@ table('admin_auth_group_access', [ 'comment' => '用户和组的对应关系' diff --git a/database/migrations/20190508101122_admin_auth_rule.php b/database/migrations/20190508101122_admin_auth_rule.php index de21f17..30305f9 100644 --- a/database/migrations/20190508101122_admin_auth_rule.php +++ b/database/migrations/20190508101122_admin_auth_rule.php @@ -1,7 +1,6 @@ table('admin_auth_rule', [ 'comment' => '权限细节' diff --git a/database/migrations/20190508152801_admin_fields.php b/database/migrations/20190508152801_admin_fields.php index 187f980..8dfe92e 100644 --- a/database/migrations/20190508152801_admin_fields.php +++ b/database/migrations/20190508152801_admin_fields.php @@ -1,7 +1,6 @@ table('admin_fields', [ 'comment' => '用于保存各个API的字段规则' diff --git a/database/migrations/20190508153800_admin_group.php b/database/migrations/20190508153800_admin_group.php index e92261d..893025d 100644 --- a/database/migrations/20190508153800_admin_group.php +++ b/database/migrations/20190508153800_admin_group.php @@ -1,7 +1,6 @@ table('admin_group', [ 'comment' => '接口组管理' diff --git a/database/migrations/20190513065521_admin_list.php b/database/migrations/20190513065521_admin_list.php new file mode 100644 index 0000000..8b7583c --- /dev/null +++ b/database/migrations/20190513065521_admin_list.php @@ -0,0 +1,94 @@ +table('admin_list', [ + 'comment' => '用于维护接口信息' + ])->setCollation('utf8mb4_general_ci'); + $table->addColumn('api_class', 'string', [ + 'limit' => 50, + 'default' => '', + 'comment' => 'api索引,保存了类和方法' + ])->addColumn('hash', 'string', [ + 'limit' => 50, + 'default' => '', + 'comment' => 'api唯一标识' + ])->addColumn('access_token', 'integer', [ + 'limit' => 2, + 'default' => 1, + 'comment' => '是否需要认证AccessToken 1:需要,0:不需要' + ])->addColumn('need_login', 'integer', [ + 'limit' => 2, + 'default' => 1, + 'comment' => '是否需要认证用户token 1:需要 0:不需要' + ])->addColumn('status', 'integer', [ + 'limit' => 2, + 'default' => 1, + 'comment' => 'API状态:0表示禁用,1表示启用' + ])->addColumn('method', 'integer', [ + 'limit' => 2, + 'default' => 2, + 'comment' => '请求方式0:不限1:Post,2:Get' + ])->addColumn('info', 'string', [ + 'limit' => 500, + 'default' => '', + 'comment' => 'api中文说明' + ])->addColumn('is_test', 'integer', [ + 'limit' => 2, + 'default' => 0, + 'comment' => '是否是测试模式:0:生产模式,1:测试模式' + ])->addColumn('return_str', 'text', [ + 'null' => true, + 'comment' => '返回数据示例' + ])->addColumn('group_hash', 'string', [ + 'limit' => 64, + 'default' => 'default', + 'comment' => '当前接口所属的接口分组' + ])->addIndex(['hash'])->create(); + + $table->changeColumn('id', 'integer', ['signed' => false]); + + } +} diff --git a/database/migrations/20190513070628_admin_menu.php b/database/migrations/20190513070628_admin_menu.php new file mode 100644 index 0000000..b26296e --- /dev/null +++ b/database/migrations/20190513070628_admin_menu.php @@ -0,0 +1,84 @@ +table('admin_menu', [ + 'comment' => '目录信息' + ])->setCollation('utf8mb4_general_ci'); + $table->addColumn('name', 'string', [ + 'limit' => 50, + 'default' => '', + 'comment' => '菜单名' + ])->addColumn('fid', 'integer', [ + 'limit' => 11, + 'default' => 0, + 'comment' => '父级菜单ID' + ])->addColumn('url', 'string', [ + 'limit' => 50, + 'default' => '', + 'comment' => '链接' + ])->addColumn('auth', 'integer', [ + 'limit' => 2, + 'default' => 0, + 'comment' => '访客权限' + ])->addColumn('sort', 'integer', [ + 'limit' => 11, + 'default' => 0, + 'comment' => '排序' + ])->addColumn('hide', 'integer', [ + 'limit' => 2, + 'default' => 0, + 'comment' => '是否显示' + ])->addColumn('icon', 'string', [ + 'limit' => 50, + 'default' => '', + 'comment' => '菜单图标' + ])->addColumn('level', 'integer', [ + 'limit' => 2, + 'default' => 0, + 'comment' => '菜单认证等级' + ])->create(); + + $table->changeColumn('id', 'integer', ['signed' => false]); + } +}