我的方案是在主库里新建一个表,把老数据手动迁移过去,并且不希望后续系统往里插数据
新表只存我手动迁移的老数据,并且老数据也能在系统里查到,现有配置如图
spring.shardingsphere.sharding.tables.ent_invoice.actual-data-nodes=ds$->{0..1}.ent_invoice$->{0..1}
spring.shardingsphere.sharding.tables.ent_invoice.databaseStrategy.inline.shardingColumn=FPFM
spring.shardingsphere.sharding.tables.ent_invoice.databaseStrategy.inline.algorithmExpression=ds$->{Math.abs(FPFM.substring(FPFM.length()-1,FPFM.length()).hashCode()) % 2}
spring.shardingsphere.sharding.tables.ent_invoice.table-strategy.inline.sharding-column=FPFM
spring.shardingsphere.sharding.tables.ent_invoice.table-strategy.inline.algorithm-expression=ent_invoice$->{Math.abs(FPFM.hashCode()) % 2}
我是不是只需要在第一行配置后面加上我的新表(ds0.ent_invoice_sk)就行,别的不用动?