提交 166a7d26 编写于 作者: T tristaZero

modify SHARDING_RULE_YAML

上级 b5653330
......@@ -43,12 +43,12 @@ public class ConfigurationYamlConverterTest {
+ " dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n" + " properties:\n"
+ " url: jdbc:mysql://localhost:3306/demo_ds_master\n" + " username: root\n" + " password: null\n";
private static final String SHARDING_RULE_YAML = " tables:\n" + " t_order:\n" + " actualDataNodes: ds_${0..1}.t_order_${0..1}\n" + " tableStrategy:\n"
+ " inline:\n" + " shardingColumn: order_id\n" + " algorithmExpression: t_order_${order_id % 2}\n"
+ " keyGeneratorColumnName: order_id\n" + " t_order_item:\n" + " actualDataNodes: ds_${0..1}.t_order_item_${0..1}\n" + " tableStrategy:\n" + " inline:\n"
+ " shardingColumn: order_id\n" + " algorithmExpression: t_order_item_${order_id % 2}\n" + " keyGeneratorColumnName: order_item_id\n" + " bindingTables:\n"
+ " - t_order,t_order_item\n" + " defaultDataSourceName: ds_1\n" + " defaultDatabaseStrategy:\n" + " inline:\n" + " shardingColumn: user_id\n"
+ " algorithmExpression: ds_${user_id % 2}";
private static final String SHARDING_RULE_YAML = " tables:\n" + " t_order:\n" + " actualDataNodes: ds_${0..1}.t_order_${0..1}\n" + " tableStrategy:\n"
+ " inline:\n" + " shardingColumn: order_id\n" + " algorithmExpression: t_order_${order_id % 2}\n" + " keyGenerator:\n"
+ " keyGeneratorColumnName: order_id\n" + " t_order_item:\n" + " actualDataNodes: ds_${0..1}.t_order_item_${0..1}\n" + " tableStrategy:\n"
+ " inline:\n" + " shardingColumn: order_id\n" + " algorithmExpression: t_order_item_${order_id % 2}\n" + " keyGenerator:\n"
+ " keyGeneratorColumnName: order_item_id\n" + " bindingTables:\n" + " - t_order,t_order_item\n" + " defaultDataSourceName: ds_1\n"
+ " defaultDatabaseStrategy:\n" + " inline:\n" + " shardingColumn: user_id\n" + " algorithmExpression: ds_${user_id % 2}";
private static final String MASTER_SLAVE_RULE_YAML = "masterDataSourceName: master_ds\n" + "name: ms_ds\n" + "slaveDataSourceNames:\n" + "- slave_ds_0\n" + "- slave_ds_1\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册