summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 04:48:59 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-17 04:48:59 +0000
commitfb6c808efc937e8b91ca8bfec4db2b159cdb87d4 (patch)
tree060494c267e8d4fd6caead9752a6bec61c1f623a
parent72a1ff33990ce6900423865db7703e8e4180848d (diff)
Adding provisions in upgrade script for duplicate orderitems (id)'s.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@925 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql b/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql
index 384cae25..82310ec8 100644
--- a/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql
+++ b/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql
@@ -34,6 +34,9 @@ ALTER TABLE makemodel ADD PRIMARY KEY (parts_id);
ALTER TABLE oe ADD PRIMARY KEY (id);
+SELECT setval('orderitemsid', 1);
+UPDATE orderitems SET id = nextval('orderitemsid');
+
ALTER TABLE orderitems ADD PRIMARY KEY (id);
ALTER TABLE parts ADD PRIMARY KEY (id);