spring:
  profiles:
    active: default

---
spring:
  shardingsphere:
    props:
      sql-show: true
      sql:
        show: true
    datasource:
      names: ds
      ds:
#        type: com.zaxxer.hikari.HikariDataSource
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        username: root
        password: 12341234
        url: jdbc:mysql://10.10.10.200:3306/matrix_v2?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
#        jdbc-url: jdbc:mysql://10.10.10.100:3306/matrix?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
        initial-size: 5
        min-idle: 5
        maxWait: 60000
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        validationQuery: SELECT 1

    rules:
      sharding:
#        tables:
#          user:
#            actual-data-nodes: ds.user_$->{0..2}
#            table-strategy:
#              standard:
#                sharding-column: id
#                sharding-algorithm-name: user-id
        auto-tables:
          user:
            actual-data-sources: ds
            sharding-strategy:
              standard:
                sharding-column: id
                sharding-algorithm-name: user-id
        sharding-algorithms:
          user-id:
#            内置分片算法
            type: MOD
            props:
              sharding-count: 3
  config:
    activate:
      on-profile: default
#            行内表达式
#            type: INLINE
#            props:
#              algorithm-expression: user_$->{id % 3}
#    mode:
#      type: Standalone

---
spring:
  config:
    activate:
      on-profile: pre-dev

  shardingsphere:
    enabled: false

  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: 12341234
    url: jdbc:mysql://10.10.10.200:3306/matrix_schema_v2?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
  sql:
    init:
      mode: ALWAYS
      schema-locations:
        - classpath:schema/*.sql
      username: root
      password: 12341234
