去掉分表逻辑
This commit is contained in:
1 parent
2d0a09c734
commit
8d3cb18a46
4 files changed
+4
-139
No files matched your search
@@ -117,17 +117,6 @@
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<!-- sharding-jdbc -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
|
||||
<version>4.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
||||
<version>4.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -2,66 +2,8 @@
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
shardingsphere:
|
||||
datasource:
|
||||
names: ds0,ds1
|
||||
ds0:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.3.243:3306/epusdt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Lqj7667213.520
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
filters: stat
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
ds1:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.3.243:3306/epusdt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Lqj7667213.520
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
filters: stat
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
props:
|
||||
sql.show: true
|
||||
sharding:
|
||||
# 默认数据源
|
||||
default-data-source-name: ds0
|
||||
default-key-generator:
|
||||
type: SNOWFLAKE
|
||||
column: id
|
||||
default-database-strategy:
|
||||
inline:
|
||||
sharding-column: id
|
||||
algorithm-expression: ds$->{id % 2}
|
||||
tables:
|
||||
exam_student_paper_answer:
|
||||
actual-data-nodes: ds$->{0..1}.exam_student_paper_answer_$->{0..1}
|
||||
table-strategy:
|
||||
inline:
|
||||
sharding-column: id
|
||||
algorithm-expression: exam_student_paper_answer_$->{id % 2}
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
|
||||
@@ -2,66 +2,8 @@
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
shardingsphere:
|
||||
datasource:
|
||||
names: ds0,ds1
|
||||
ds0:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://172.16.0.4:3308/epusdt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Lgkj@123
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
filters: stat
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
ds1:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://172.16.0.4:3308/epusdt?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Lgkj@123
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
filters: stat
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
props:
|
||||
sql.show: true
|
||||
sharding:
|
||||
# 默认数据源
|
||||
default-data-source-name: ds0
|
||||
default-key-generator:
|
||||
type: SNOWFLAKE
|
||||
column: id
|
||||
default-database-strategy:
|
||||
inline:
|
||||
sharding-column: id
|
||||
algorithm-expression: ds$->{id % 2}
|
||||
tables:
|
||||
exam_student_paper_answer:
|
||||
actual-data-nodes: ds$->{0..1}.exam_student_paper_answer_$->{0..1}
|
||||
table-strategy:
|
||||
inline:
|
||||
sharding-column: id
|
||||
algorithm-expression: exam_student_paper_answer_$->{id % 2}
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
|
||||
Reference in new issue
Block a user