hi!
I am doing a copy function for all tables.
my primary key is a text with sequence uuid generator
for the copy function that creates a duplicate record in all the tables having the same userid
e.g.
tproduct table
- productid = 6E18D017-F54A-4D36-942A-162FEA1070EB, userid = 1543272A-1C31-40CA-8F99-14F94E4E0BB2
tuser table
- userid = 1543272A-1C31-40CA-8F99-14F94E4E0BB2
in order to create a non-duplicate record, I replace the first 8 characters with a prefix like (AAAAAAAA, AAAAAAAB, AAAAAAAC, etc)
after execution, the tables will now have
tproduct table
1.productid = 6E18D017-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
2.productid = AAAAAAAA-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
3.productid = AAAAAAAB-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
4.productid = AAAAAAAC-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
5.productid = AAAAAAAD-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
6.productid = AAAAAAAE-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
7.productid = AAAAAAAF-F54A-4D36-942A-162FEA1070EB, userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
tuser table
1.userid = 1543272A-1C31-40CA-8F99-14F94E4E0BB2
2.userid = AAAAAAAA-1C31-40CA-8F99-14F94E4E0BB2
3.userid = AAAAAAAB-1C31-40CA-8F99-14F94E4E0BB2
4.userid = AAAAAAAC-1C31-40CA-8F99-14F94E4E0BB2
5.userid = AAAAAAAD-1C31-40CA-8F99-14F94E4E0BB2
6.userid = AAAAAAAE-1C31-40CA-8F99-14F94E4E0BB2
7.userid = AAAAAAAF-1C31-40CA-8F99-14F94E4E0BB2
I thought this was ok but at some time it started to give me a wrapped exception for “AAAAAAAG”
record.userid = “AAAAAAAG-1C31-40CA-8F99-14F94E4E0BB2”
"Error during evaluation:Wrapped java.lang.IllegalArgumentException: Setting dataprovider with name 'idsystem_organization', type 'TEXT' with value of wrong type AAAAAAAG-1C31-40CA-8F99-14F94E4E0BB2"
However, I tried this pattern and it worked. After AAAAAAAF, then AAAAAABA to AAAAAABF, so on…
How am I be going to make them unique in the simplest way? Generating a new UUID and updating the foreign keys etc will take a very long time to process.