配置语句,扩容直接修改tableNames即可
/*+ mycat:createTable{
"schemaName":"mycatdb",
"shardingTable":{
"createTableSQL":"CREATE TABLE `mycatdb`.`test` (`name` varchar(10),`create_time` varchar(30));",
"function":{
"clazz":"io.mycat.router.mycat1xfunction.PartitionByMonth",
"properties":{
"beginDate":"2021-01-01 00:00:00",
"dateFormat":"yyyy-MM-dd hh:mm:ss",
"endDate":"",
"columnName":"create_time"
},
"ranges":{}
},
"partition":{
"schemaNames":"1cloud",
"tableNames":"test_$202101-202104",
"targetNames":"prototype"
}
},
"tableName":"test"
} */;
参考: