SETVAL the permission.grp_tree sequence after adding pinned IDs user/dbs/lp893345_avoid_pgt_upgrade_conflicts
authorDan Scott <dscott@laurentian.ca>
Thu, 29 Dec 2011 18:46:24 +0000 (13:46 -0500)
committerDan Scott <dscott@laurentian.ca>
Thu, 29 Dec 2011 18:49:27 +0000 (13:49 -0500)
If we do not update the associated sequence after adding pinned IDs,
sites will be unable to add new permission groups until enough attempts
have failed. Let's bypass that little bit of pain.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/version-upgrade/2.0-2.1-upgrade-db.sql

index 9e34a9d..36b5700 100644 (file)
@@ -5797,7 +5797,7 @@ INSERT INTO permission.grp_tree (id, name, parent, description, perm_interval, u
                        id = 15
        );
 
-
+SELECT SETVAL('permission.grp_tree_id_seq'::TEXT, (SELECT MAX(id) FROM permission.grp_tree));
 
 INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
        SELECT