+ Use This Table All Design

MySQL Create Table SQL

Table Structure: okayapi_access:/tablelist/okayapi_access.html


-- MySQL Table okayapi_access
-- From: OkayAPI.com
CREATE TABLE `okayapi_access` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `debug` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否为调试表,只允许在开发环境使用,测试和线上环境禁用',
    `name` varchar(50) NOT NULL COMMENT '实际表名,例如 apijson_user',
    `alias` varchar(20) NOT NULL COMMENT '外部调用的表别名,例如 User',
    `get` varchar(100) NOT NULL DEFAULT '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT '允许 get 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]
用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。
TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单,反正是开发内部用,不需要复杂查询。',
    `head` varchar(100) NOT NULL DEFAULT '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT '允许 head 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `gets` varchar(100) NOT NULL DEFAULT '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT '允许 gets 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `heads` varchar(100) NOT NULL DEFAULT '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT '允许 heads 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `post` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT '允许 post 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `put` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT '允许 put 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `delete` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT '允许 delete 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
    `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    KEY `debug` (`debug`),
    KEY `name` (`name`),
    KEY `alias` (`alias`),
    KEY `get` (`get`),
    KEY `head` (`head`),
    KEY `gets` (`gets`),
    KEY `heads` (`heads`),
    KEY `post` (`post`),
    KEY `put` (`put`),
    KEY `delete` (`delete`),
    KEY `date` (`date`),
    PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT 'web开发-权限配置';

After replication, you can go to the database to create the database table.


MySQL database table structure design

Displaying 1-11 of 11 results.
Field NameField TypeDefaultIS NULLField CommentIndexDemo Data
debugtinyint(2)0是否为调试表,只允许在开发环境使用,测试和线上环境禁用0
namevarchar(50)实际表名,例如 apijson_userUnique Index
aliasvarchar(20)外部调用的表别名,例如 UserUnique Index
getvarchar(100)["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]允许 get 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"] 用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。 TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单,反正是开发内部用,不需要复杂查询。["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]
headvarchar(100)["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]允许 head 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]
getsvarchar(100)["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]允许 gets 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]
headsvarchar(100)["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]允许 heads 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]
postvarchar(100)["OWNER", "ADMIN"]允许 post 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["OWNER", "ADMIN"]
putvarchar(100)["OWNER", "ADMIN"]允许 put 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["OWNER", "ADMIN"]
deletevarchar(100)["OWNER", "ADMIN"]允许 delete 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]["OWNER", "ADMIN"]
datetimestampCURRENT_TIMESTAMP创建时间CURRENT_TIMESTAMP

Guess You Like

MySQL Table Design okayapi_seo_article

MySQL Table Design okayapi_article_ad

MySQL Table Design okayapi_article_cate

MySQL Table Design okayapi_article_tag

MySQL Table Design okayapi_article_map

MySQL Table Design okayapi_comment

MySQL Table Design okayapi_document

MySQL Table Design okayapi_function

MySQL Table Design okayapi_login

MySQL Table Design okayapi_moment

MySQL Table Design okayapi_praise

MySQL Table Design okayapi_request

MySQL Table Design okayapi_response

MySQL Table Design okayapi_test_record

MySQL Table Design okayapi_verify

MySQL Table Design okayapi_apijson_privacy

MySQL Table Design okayapi_apijson_user

TOP ↑