Repository navigation
Expand file tree
/
Copy pathapplication-sharding-auto-tables.properties
More file actions
55 lines (43 loc) · 3.13 KB
/
Copy pathapplication-sharding-auto-tables.properties
File metadata and controls
55 lines (43 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.shardingsphere.datasource.names=ds-0,ds-1
spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.ds-0.username=root
spring.shardingsphere.datasource.ds-0.password=apijson
spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.ds-1.username=root
spring.shardingsphere.datasource.ds-1.password=apijson
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database-inline
spring.shardingsphere.rules.sharding.binding-tables[0]=Moment,Comment
spring.shardingsphere.rules.sharding.autotables.Moment.actual-datasources=ds-${0..1}
spring.shardingsphere.rules.sharding.auto-tables.Moment.sharding-strategy.standard.sharding-column=id
spring.shardingsphere.rules.sharding.auto-tables.Moment.sharding-strategy.standard.sharding-algorithm-name=auto-mod
spring.shardingsphere.rules.sharding.auto-tables.Moment.key-generate-strategy.column=userId
spring.shardingsphere.rules.sharding.auto-tables.Moment.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.auto-tables.Comment.actual-datasources=ds-${0..1}
spring.shardingsphere.rules.sharding.auto-tables.Comment.sharding-strategy.standard.sharding-column=id
spring.shardingsphere.rules.sharding.auto-tables.Comment.sharding-strategy.standard.sharding-algorithm-name=auto-mod
spring.shardingsphere.rules.sharding.auto-tables.Comment.key-generate-strategy.column=id
spring.shardingsphere.rules.sharding.auto-tables.Comment.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.auto-mod.type=mod
spring.shardingsphere.rules.sharding.sharding-algorithms.auto-mod.props.sharding-count=4
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE

