Skip to content

Commit

Permalink
Merge pull request #3162 from tdilauro/3161-migration-offset-null-id-fix
Browse files Browse the repository at this point in the history
Avoid null ids when migrating from DVN 3.6.3 to DV 4.x
  • Loading branch information
kcondon committed Jul 8, 2016
2 parents a1c9c39 + 1ca2e9b commit dcea42d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/migration/migration_presteps.txt
Expand Up @@ -127,13 +127,13 @@ psql -h localhost -U postgres <4.0 database name> -f /tmp/dvn3_data.sql
----------------------------------------------

-- offsets
update _dvn3_vdcnetwork set id = id + (select max(id) from dvobject);
update _dvn3_vdc set id = id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_vdcrole set vdc_id = vdc_id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_vdc_usergroup set vdcs_id = vdcs_id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_vdc_linked_collections set vdc_id = vdc_id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_study set owner_id = owner_id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_vdccollection set owner_id = owner_id + (select max(id) from _dvn3_vdcnetwork);
update _dvn3_vdcnetwork set id = id + (select coalesce(max(id), 0) from dvobject);
update _dvn3_vdc set id = id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);
update _dvn3_vdcrole set vdc_id = vdc_id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);
update _dvn3_vdc_usergroup set vdcs_id = vdcs_id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);
update _dvn3_vdc_linked_collections set vdc_id = vdc_id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);
update _dvn3_study set owner_id = owner_id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);
update _dvn3_vdccollection set owner_id = owner_id + (select coalesce(max(id), 0) from _dvn3_vdcnetwork);

-- note: need to determine what offset to use, based on the file scripts
--update _dvn3_studyfile_vdcuser set studyfiles_id = studyfiles_id +100000;
Expand Down

0 comments on commit dcea42d

Please sign in to comment.