summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-09 17:42:07 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-09 17:42:07 +0000
commitb02fc2e1524e6163b88541680adf817f733f4849 (patch)
tree81b1487c383607cef82440da7a24a956befd55d5 /sql
parentea383fecc03ff242fe7e0b6b64e2ace82aa8f5d8 (diff)
initial script for upgrade to 2.6.18. Adds primary key to acc_trans
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@48 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/Pg-upgrade-2.6.17-2.6.18.sql11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/Pg-upgrade-2.6.17-2.6.18.sql b/sql/Pg-upgrade-2.6.17-2.6.18.sql
new file mode 100644
index 00000000..693fed80
--- /dev/null
+++ b/sql/Pg-upgrade-2.6.17-2.6.18.sql
@@ -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;
+