Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
78e058aa
Commit
78e058aa
authored
Oct 22, 2016
by
nobodyiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt for github deployment
parent
b1d719a1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
705 additions
and
4 deletions
+705
-4
application.yml
apollo-adminservice/src/main/resources/application.yml
+1
-1
application.yml
apollo-assembly/src/main/resources/application.yml
+1
-1
application.yml
apollo-configservice/src/main/resources/application.yml
+1
-1
pom.xml
apollo-core/pom.xml
+15
-0
application.yml
apollo-portal/src/main/resources/application.yml
+1
-1
build.sh
scripts/build.sh
+44
-0
apolloconfigdb.sql
scripts/sql/apolloconfigdb.sql
+349
-0
apolloportaldb.sql
scripts/sql/apolloportaldb.sql
+293
-0
No files found.
apollo-adminservice/src/main/resources/application.yml
View file @
78e058aa
...
...
@@ -2,7 +2,7 @@ spring:
application
:
name
:
apollo-adminservice
profiles
:
active
:
ctrip
active
:
${apollo_profile}
ctrip
:
appid
:
100003172
...
...
apollo-assembly/src/main/resources/application.yml
View file @
78e058aa
spring
:
profiles
:
active
:
ctrip
active
:
${apollo_profile}
logging
:
level
:
...
...
apollo-configservice/src/main/resources/application.yml
View file @
78e058aa
...
...
@@ -2,7 +2,7 @@ spring:
application
:
name
:
apollo-configservice
profiles
:
active
:
ctrip
active
:
${apollo_profile}
ctrip
:
appid
:
100003171
...
...
apollo-core/pom.xml
View file @
78e058aa
...
...
@@ -41,4 +41,19 @@
</dependency>
<!-- end of log -->
</dependencies>
<profiles>
<profile>
<id>
github
</id>
<properties>
<package.environment>
github
</package.environment>
</properties>
<dependencies>
<!-- disable cat for outside use -->
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-buildtools
</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
apollo-portal/src/main/resources/application.yml
View file @
78e058aa
...
...
@@ -2,7 +2,7 @@ spring:
application
:
name
:
apollo-portal
profiles
:
active
:
ctrip
active
:
${apollo_profile}
ctrip
:
appid
:
100003173
...
...
scripts/build.sh
0 → 100755
View file @
78e058aa
#!/bin/sh
# apollo config db info
apollo_config_db_url
=
jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding
=
utf8
apollo_config_db_username
=
root
apollo_config_db_password
=
# apollo portal db info
apollo_portal_db_url
=
jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding
=
utf8
apollo_portal_db_username
=
root
apollo_portal_db_password
=
# meta server url
dev_meta
=
http://localhost:8080
fat_meta
=
http://localhost:8080
uat_meta
=
http://localhost:8080
pro_meta
=
http://localhost:8080
META_SERVERS_OPTS
=
"-Ddev_meta=
$dev_meta
-Dfat_meta=
$fat_meta
-Duat_meta=
$uat_meta
-Dpro_meta=
$pro_meta
"
# =============== Please do not modify the following content =============== #
cd
..
# package config-service and admin-service
echo
"==== starting to build config-service and admin-service ===="
mvn clean package
-DskipTests
-pl
apollo-configservice,apollo-adminservice
-am
-Pgithub
-Dapollo_profile
=
dev
-Dspring_datasource_url
=
$apollo_config_db_url
-Dspring_datasource_username
=
$apollo_config_db_username
-Dspring_datasource_password
=
$apollo_config_db_password
echo
"==== building config-service and admin-service finished ===="
echo
"==== starting to build portal ===="
mvn clean package
-DskipTests
-pl
apollo-portal
-am
-Pgithub
-Dapollo_profile
=
dev
-Dspring_datasource_url
=
$apollo_portal_db_url
-Dspring_datasource_username
=
$apollo_portal_db_username
-Dspring_datasource_password
=
$apollo_portal_db_password
$META_SERVERS_OPTS
echo
"==== building portal finished ===="
echo
"==== starting to build client ===="
mvn clean
install
-DskipTests
-pl
apollo-client
-am
-Pgithub
$META_SERVERS_OPTS
echo
"==== building portal finished ===="
scripts/sql/apolloconfigdb.sql
0 → 100644
View file @
78e058aa
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!40101 SET NAMES utf8 */
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
;
#
Create
Database
#
------------------------------------------------------------
CREATE
DATABASE
IF
NOT
EXISTS
ApolloConfigDB
DEFAULT
CHARACTER
SET
=
utf8mb4
;
Use
ApolloConfigDB
;
#
Dump
of
table
app
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`app`
;
CREATE
TABLE
`app`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'应用名'
,
`OrgId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门Id'
,
`OrgName`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门名字'
,
`OwnerName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerName'
,
`OwnerEmail`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerEmail'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
FULLTEXT
KEY
`Name`
(
`Name`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用表'
;
#
Dump
of
table
appnamespace
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`appnamespace`
;
CREATE
TABLE
`appnamespace`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`Name`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'namespace名字,注意,需要全局唯一'
,
`AppId`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'app id'
,
`Format`
varchar
(
32
)
NOT
NULL
DEFAULT
'properties'
COMMENT
'namespace的format类型'
,
`IsPublic`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'namespace是否为公共'
,
`Comment`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`Name_AppId`
(
`Name`
,
`AppId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用namespace定义'
;
#
Dump
of
table
audit
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`audit`
;
CREATE
TABLE
`audit`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`EntityName`
varchar
(
50
)
NOT
NULL
DEFAULT
'default'
COMMENT
'表名'
,
`EntityId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'记录ID'
,
`OpName`
varchar
(
50
)
NOT
NULL
DEFAULT
'default'
COMMENT
'操作类型'
,
`Comment`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'备注'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'日志审计表'
;
#
Dump
of
table
cluster
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`cluster`
;
CREATE
TABLE
`cluster`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`Name`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'集群名字'
,
`AppId`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'App id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_AppId_Name`
(
`AppId`
,
`Name`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'集群'
;
#
Dump
of
table
commit
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`commit`
;
CREATE
TABLE
`commit`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`ChangeSets`
longtext
NOT
NULL
COMMENT
'修改变更集'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`ClusterName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ClusterName'
,
`NamespaceName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'namespaceName'
,
`Comment`
varchar
(
500
)
DEFAULT
NULL
COMMENT
'备注'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`ClusterName`
(
`ClusterName`
(
191
)),
KEY
`NamespaceName`
(
`NamespaceName`
(
191
))
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'commit 历史表'
;
#
Dump
of
table
instance
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`instance`
;
CREATE
TABLE
`instance`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`AppId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`ClusterName`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ClusterName'
,
`DataCenter`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Data Center Name'
,
`Ip`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'instance ip'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
UNIQUE
KEY
`IX_UNIQUE_KEY`
(
`AppId`
,
`ClusterName`
,
`Ip`
,
`DataCenter`
),
KEY
`IX_IP`
(
`Ip`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'使用配置的应用实例'
;
#
Dump
of
table
instanceconfig
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`instanceconfig`
;
CREATE
TABLE
`instanceconfig`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`InstanceId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'Instance Id'
,
`ConfigAppId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Config App Id'
,
`ConfigClusterName`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Config Cluster Name'
,
`ConfigNamespaceName`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Config Namespace Name'
,
`ReleaseKey`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'发布的Key'
,
`ReleaseDeliveryTime`
timestamp
NULL
DEFAULT
NULL
COMMENT
'配置获取时间'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
UNIQUE
KEY
`IX_UNIQUE_KEY`
(
`InstanceId`
,
`ConfigAppId`
,
`ConfigClusterName`
,
`ConfigNamespaceName`
),
KEY
`IX_ReleaseKey`
(
`ReleaseKey`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_Valid_Namespace`
(
`ConfigAppId`
,
`ConfigClusterName`
,
`ConfigNamespaceName`
,
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用实例的配置信息'
;
#
Dump
of
table
item
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`item`
;
CREATE
TABLE
`item`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`NamespaceId`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'集群NamespaceId'
,
`Key`
varchar
(
128
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项Key'
,
`Value`
longtext
NOT
NULL
COMMENT
'配置项值'
,
`Comment`
varchar
(
1024
)
DEFAULT
''
COMMENT
'注释'
,
`LineNum`
int
(
10
)
unsigned
DEFAULT
'0'
COMMENT
'行号'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_GroupId`
(
`NamespaceId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'配置项目'
;
#
Dump
of
table
namespace
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`namespace`
;
CREATE
TABLE
`namespace`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`ClusterName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Cluster Name'
,
`NamespaceName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Namespace Name'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId_ClusterName_NamespaceName`
(
`AppId`
(
191
),
`ClusterName`
(
191
),
`NamespaceName`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'命名空间'
;
#
Dump
of
table
namespacelock
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`namespacelock`
;
CREATE
TABLE
`namespacelock`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增id'
,
`NamespaceId`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'集群NamespaceId'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
'default'
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
`IsDeleted`
bit
(
1
)
DEFAULT
b
'0'
COMMENT
'软删除'
,
PRIMARY
KEY
(
`Id`
),
UNIQUE
KEY
`IX_NamespaceId`
(
`NamespaceId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'namespace的编辑锁'
;
#
Dump
of
table
privilege
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`privilege`
;
CREATE
TABLE
`privilege`
(
`id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'Name'
,
`PrivilType`
varchar
(
50
)
NOT
NULL
DEFAULT
'default'
COMMENT
'PrivilType'
,
`NamespaceId`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'NamespaceId'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`id`
),
KEY
`Name_PrivilType_NamespaceId`
(
`Name`
(
191
),
`PrivilType`
,
`NamespaceId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'权限'
;
#
Dump
of
table
release
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`release`
;
CREATE
TABLE
`release`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`ReleaseKey`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'发布的Key'
,
`Name`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'发布名字'
,
`Comment`
varchar
(
256
)
DEFAULT
NULL
COMMENT
'发布说明'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`ClusterName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ClusterName'
,
`NamespaceName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'namespaceName'
,
`Configurations`
longtext
NOT
NULL
COMMENT
'发布配置'
,
`IsAbandoned`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'是否废弃'
,
`Status`
tinyint
(
4
)
NOT
NULL
DEFAULT
'1'
COMMENT
'发布的状态,0:废弃 1:正常 2:灰度'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId_ClusterName_GroupName`
(
`AppId`
(
191
),
`ClusterName`
(
191
),
`NamespaceName`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_ReleaseKey`
(
`ReleaseKey`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'发布'
;
#
Dump
of
table
releasemessage
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`releasemessage`
;
CREATE
TABLE
`releasemessage`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`Message`
varchar
(
1024
)
NOT
NULL
DEFAULT
''
COMMENT
'发布的消息内容'
,
`DataChange_LastTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_Message`
(
`Message`
(
191
))
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'发布消息'
;
#
Dump
of
table
serverconfig
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`serverconfig`
;
CREATE
TABLE
`serverconfig`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Key`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项Key'
,
`Cluster`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置对应的集群,default为不针对特定的集群'
,
`Value`
varchar
(
2048
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项值'
,
`Comment`
varchar
(
1024
)
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_Key`
(
`Key`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'配置服务自身配置'
;
#
Config
#
------------------------------------------------------------
INSERT
INTO
`serverconfig`
(
`Key`
,
`Cluster`
,
`Value`
,
`Comment`
)
VALUES
(
'eureka.service.url'
,
'default'
,
'http://localhost:8080/eureka/'
,
'Eureka服务Url'
),
(
'namespace.lock.switch'
,
'default'
,
'false'
,
'一次发布只能有一个人修改开关'
),
(
'item.value.length.limit'
,
'default'
,
'20000'
,
'item value最大长度限制'
),
(
'appnamespace.private.enable'
,
'default'
,
'false'
,
'是否开启private namespace'
),
(
'item.key.length.limit'
,
'default'
,
'128'
,
'item key 最大长度限制'
);
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;
\ No newline at end of file
scripts/sql/apolloportaldb.sql
0 → 100644
View file @
78e058aa
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!40101 SET NAMES utf8 */
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
;
#
Create
Database
#
------------------------------------------------------------
CREATE
DATABASE
IF
NOT
EXISTS
ApolloPortalDB
DEFAULT
CHARACTER
SET
=
utf8mb4
;
Use
ApolloPortalDB
;
#
Dump
of
table
app
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`app`
;
CREATE
TABLE
`app`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'应用名'
,
`OrgId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门Id'
,
`OrgName`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门名字'
,
`OwnerName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerName'
,
`OwnerEmail`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerEmail'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
FULLTEXT
KEY
`Name`
(
`Name`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用表'
;
#
Dump
of
table
appnamespace
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`appnamespace`
;
CREATE
TABLE
`appnamespace`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`Name`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'namespace名字,注意,需要全局唯一'
,
`AppId`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'app id'
,
`Format`
varchar
(
32
)
NOT
NULL
DEFAULT
'properties'
COMMENT
'namespace的format类型'
,
`IsPublic`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'namespace是否为公共'
,
`Comment`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`Name_AppId`
(
`Name`
,
`AppId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用namespace定义'
;
#
Dump
of
table
consumer
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`consumer`
;
CREATE
TABLE
`consumer`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'应用名'
,
`OrgId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门Id'
,
`OrgName`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门名字'
,
`OwnerName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerName'
,
`OwnerEmail`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerEmail'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'开放API消费者'
;
#
Dump
of
table
consumeraudit
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`consumeraudit`
;
CREATE
TABLE
`consumeraudit`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'Consumer Id'
,
`Uri`
varchar
(
1024
)
NOT
NULL
DEFAULT
''
COMMENT
'访问的Uri'
,
`Method`
varchar
(
16
)
NOT
NULL
DEFAULT
''
COMMENT
'访问的Method'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_ConsumerId`
(
`ConsumerId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer审计表'
;
#
Dump
of
table
consumerrole
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`consumerrole`
;
CREATE
TABLE
`consumerrole`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'Consumer Id'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_ConsumerId_RoleId`
(
`ConsumerId`
,
`RoleId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer和role的绑定表'
;
#
Dump
of
table
consumertoken
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`consumertoken`
;
CREATE
TABLE
`consumertoken`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'ConsumerId'
,
`Token`
varchar
(
128
)
NOT
NULL
DEFAULT
''
COMMENT
'token'
,
`Expires`
datetime
NOT
NULL
DEFAULT
'2099-01-01 00:00:00'
COMMENT
'token失效时间'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
UNIQUE
KEY
`IX_Token`
(
`Token`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer token表'
;
#
Dump
of
table
favorite
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`favorite`
;
CREATE
TABLE
`favorite`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`UserId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'收藏的用户'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Position`
int
(
32
)
NOT
NULL
DEFAULT
'10000'
COMMENT
'收藏顺序'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`IX_UserId`
(
`UserId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
23
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用收藏表'
;
#
Dump
of
table
permission
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`permission`
;
CREATE
TABLE
`permission`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`PermissionType`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'权限类型'
,
`TargetId`
varchar
(
256
)
NOT
NULL
DEFAULT
''
COMMENT
'权限对象类型'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_TargetId_PermissionType`
(
`TargetId`
(
191
),
`PermissionType`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'permission表'
;
#
Dump
of
table
role
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`role`
;
CREATE
TABLE
`role`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`RoleName`
varchar
(
256
)
NOT
NULL
DEFAULT
''
COMMENT
'Role name'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_RoleName`
(
`RoleName`
(
191
)),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'角色表'
;
#
Dump
of
table
rolepermission
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`rolepermission`
;
CREATE
TABLE
`rolepermission`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`PermissionId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Permission Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_PermissionId`
(
`PermissionId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'角色和权限的绑定表'
;
#
Dump
of
table
serverconfig
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`serverconfig`
;
CREATE
TABLE
`serverconfig`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Key`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项Key'
,
`Value`
varchar
(
2048
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项值'
,
`Comment`
varchar
(
1024
)
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_Key`
(
`Key`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'配置服务自身配置'
;
#
Dump
of
table
userrole
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`userrole`
;
CREATE
TABLE
`userrole`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`UserId`
varchar
(
128
)
DEFAULT
''
COMMENT
'用户身份标识'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_UserId_RoleId`
(
`UserId`
,
`RoleId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'用户和role的绑定表'
;
#
Config
#
------------------------------------------------------------
INSERT
INTO
`serverconfig`
(
`Key`
,
`Value`
,
`Comment`
)
VALUES
(
'apollo.portal.envs'
,
'dev'
,
'可支持的环境列表'
),
(
'organizations'
,
'[{
\"
orgId
\"
:
\"
TEST1
\"
,
\"
orgName
\"
:
\"
样例部门1
\"
},{
\"
orgId
\"
:
\"
TEST2
\"
,
\"
orgName
\"
:
\"
样例部门2
\"
}]'
,
'部门列表'
),
(
'superAdmin'
,
'apollo'
,
'Portal超级管理员'
),
(
'api.readTimeout'
,
'10000'
,
'http接口read timeout'
),
(
'consumer.token.salt'
,
'someSalt'
,
'consumer token salt'
);
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment