i have 2 tables with the same unique id. i want to change table1 unique_id sequence from (1-100) to random 8 digit ids (43342359 - 83083224) and cascade that to table2.
what i have:
- table1
id1 (primary)
unique_id(index)
option_id(index)
value1
value2
- table2
id2 (primary)
unique_id (index)
other1
other2
what i would like to achieve:
- table1
unique_id (primary)
option_id (index)
value1
value2
- table2
id2 (primary)
unique_id (index)(constraint cascade)- on table1 update/delete
other1
other2
furthermore:
unique_ids are a range from 1 - 100 which interferes with another db with same unique_ids but different option_id. basicaly i would like to join 2 databases with the same scheme and create new unique_id primary on that, with cascade constraint as mentioned.
Update:
found a possible solution here https://gist.github.com/leenasn/875796
is there a simpler way?
MySQLexpert but no doubt one will be along shortly. – Paul White Feb 18 at 12:14