My current database consists of vehicle workshop related information. One of the base table is workshop_details with primary key as workshop_id.That is a 3 digit integer of datatype.
We do have one column named as authorised_by_shell with string datatype value Y/N.
Now a new requirement came to split an existing workshop into 2 workshops without changing the primary key(workshop_id) because the workshop_id is so important for that workshop for client and its change will impact some more changes in client’s 3rd party systems.
Proposed solution was creating a composite key with workshop_id+authorised_by_shell.
Because for one workshop, column named as authorised_by_shell will always have Y/N values. It will not be same for one workshop.
In the below table we can see workshop_id as pk. as i explained above for workshop_id 121 its authorised_by_shell value will be either Y/N.
So proposed solution will be workshop_id will become 121_Y/121_N as composite key and this will impact around 4 other tables where they use workshop_id as foreign key there.
Can anyone suggest a better approach here.
much appreciated.
2