From fb6c808efc937e8b91ca8bfec4db2b159cdb87d4 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 17 Mar 2007 04:48:59 +0000 Subject: 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 --- sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/legacy') 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); -- cgit v1.2.3