INSERT INTO vandelay.merge_profile (id, owner, name, preserve_spec)
VALUES (2, 1, oils_i18n_gettext(2, 'Full Overlay', 'vmp', 'name'), '901c');
+SELECT SETVAL('vandelay.merge_profile'::TEXT, 100);
+
-- user activity seed data --
INSERT INTO config.usr_activity_type (id, ewho, ewhat, ehow, egroup, label) VALUES
--- /dev/null
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+--stock evergreen comes with 2 merge profiles; move any custom profiles
+UPDATE vandelay.merge_profile SET id = id + 100 WHERE id > 2;
+
+--update the same ids in org unit settings, stored in double quotes
+UPDATE actor.org_unit_setting
+ SET value = '"' || merge_profile_id+100 || '"'
+ FROM (
+ SELECT id, (regexp_matches(value, '"(\d+)"'))[1]::int as merge_profile_id FROM actor.org_unit_setting
+ WHERE name IN (
+ 'acq.upload.default.vandelay.low_quality_fall_thru_profile',
+ 'acq.upload.default.vandelay.merge_profile'
+ )
+ ) as foo
+ WHERE actor.org_unit_setting.id = foo.id
+ AND foo.merge_profile_id > 2;
+
+--set sequence's next value to 100, or more if necessary
+SELECT SETVAL('vandelay.merge_profile_id_seq', GREATEST(100, (SELECT MAX(id) FROM vandelay.merge_profile)));
+
+COMMIT;