Hey all,
I'm in the process of updating custom code for one of our purchased apps. The vendor had all the users and groups in one table called people, and in the new version, split that out into two tables called users and groups. In the old version, all the users and groups had positive numbers for IDs. In the new one, all the groups have to have negative numbers for ID's, and all the users have positive numbers.
I'm trying to migrate the users into the users table (new version) from the people table (old version). One of the columns in the user table is "group_id", which is a foreign key for the groups table.
I have a lookup table which has a PK, the old group_id, the new group_id, and the group name.
My question is how to write the insert so that the new group_id is inserted instead of the old group_id (which fails the constraints since the old one is positive and the new one is negative).
Thanks in advance,
Danny
I'm in the process of updating custom code for one of our purchased apps. The vendor had all the users and groups in one table called people, and in the new version, split that out into two tables called users and groups. In the old version, all the users and groups had positive numbers for IDs. In the new one, all the groups have to have negative numbers for ID's, and all the users have positive numbers.
I'm trying to migrate the users into the users table (new version) from the people table (old version). One of the columns in the user table is "group_id", which is a foreign key for the groups table.
I have a lookup table which has a PK, the old group_id, the new group_id, and the group name.
My question is how to write the insert so that the new group_id is inserted instead of the old group_id (which fails the constraints since the old one is positive and the new one is negative).
Thanks in advance,
Danny