azexcy commented on issue #25182:
URL: 
https://github.com/apache/shardingsphere/issues/25182#issuecomment-1518981248

   I tested it locally, the  `ds_attach_segment` migration as expected
   
   ```
   ➜  ~ psql --host=localhost --port=3307 postgres root
   Password for user root:
   psql (14.7, server 12.3-ShardingSphere-Proxy 5.3.3-SNAPSHOT-dirty-dfb83fc)
   Type "help" for help.
   
   postgres=> CREATE DATABASE sharding_db;
   CREATE DATABASE
   postgres=> \c sharding_db
   psql (14.7, server 12.3-ShardingSphere-Proxy 5.3.3-SNAPSHOT-dirty-dfb83fc)
   You are now connected to database "sharding_db" as user "root".
   sharding_db=> REGISTER STORAGE UNIT ds_0 (
   sharding_db(>     URL="jdbc:postgresql://127.0.0.1:5432/ds_0",
   sharding_db(>     USER="postgres",
   sharding_db(>     PASSWORD="postgres"
   sharding_db(> );
   SUCCESS
   sharding_db=>
   sharding_db=> REGISTER STORAGE UNIT ds_1 (
   sharding_db(>     URL="jdbc:postgresql://127.0.0.1:5432/ds_1",
   sharding_db(>     USER="postgres",
   sharding_db(>     PASSWORD="postgres"
   sharding_db(> );
   SUCCESS
   sharding_db=> REGISTER MIGRATION SOURCE STORAGE UNIT ds (
   sharding_db(>     URL="jdbc:postgresql://127.0.0.1:5432/cdc_db",
   sharding_db(>     USER="postgres",
   sharding_db(>     PASSWORD="201314",
   sharding_db(>     
PROPERTIES("minPoolSize"="1","maxPoolSize"="20","idleTimeout"="60000")
   sharding_db(> );
   SUCCESS
   sharding_db=> CREATE SHARDING TABLE RULE ds_attach_segment (
   sharding_db(> STORAGE_UNITS(ds_0,ds_1),
   sharding_db(> 
SHARDING_COLUMN=md5,TYPE(NAME="hash_mod",PROPERTIES("sharding-count"="2"))
   sharding_db(> );
   SUCCESS
   sharding_db=> MIGRATE TABLE ds.ds_attach_segment into 
sharding_db.ds_attach_segment;
   SUCCESS
   sharding_db=> SHOW MIGRATION LIST;
                        id                     |           tables            | 
job_item_count | active |     create_time     | stop_time
   
--------------------------------------------+-----------------------------+----------------+--------+---------------------+-----------
    j0102p0000de4d44121708195f51503f6c146053fd | ds.public.ds_attach_segment | 
1              | true   | 2023-04-23 15:32:05 |
   (1 row)
   
   sharding_db=> select * from ds_attach_segment;
    userid | md5 | filename |      createtime       | filepath | partcount | 
uuid | isdelete | length | sid
   
--------+-----+----------+-----------------------+----------+-----------+------+----------+--------+-----
    1      | 2   | 3        | 2023-04-04 15:29:35.0 | cccc     |         1 | 
123  | true     |   1111 | dd
   (1 row)
   
   sharding_db=>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to