[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [48] trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql
- Subject: SF.net SVN: ledger-smb: [48] trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql
- From: ..hidden..
- Date: Sat, 09 Sep 2006 10:42:09 -0700
Revision: 48
http://svn.sourceforge.net/ledger-smb/?rev=48&view=rev
Author: linuxpoet
Date: 2006-09-09 10:42:07 -0700 (Sat, 09 Sep 2006)
Log Message:
-----------
initial script for upgrade to 2.6.18. Adds primary key to acc_trans
Added Paths:
-----------
trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql
Added: trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql
===================================================================
--- trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql (rev 0)
+++ trunk/sql/Pg-upgrade-2.6.17-2.6.18.sql 2006-09-09 17:42:07 UTC (rev 48)
@@ -0,0 +1,11 @@
+-- adding primary key to acc_trans
+
+BEGIN;
+LOCK acc_trans in EXCLUSIVE mode;
+ALTER TABLE acc_trans ADD COLUMN entry_id bigint;
+CREATE SEQUENCE acctrans_entry_id_seq;
+ALTER TABLE acc_trans ALTER COLUMN entry_id SET DEFAULT nextval('acctrans_entry_id_seq');
+UPDATE acc_trans SET entry_id = nextval('acctrans_entry_id_seq');
+ALTER TABLE acc_trans ADD PRIMARY key (entry_id);
+COMMIT;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.