From a7b11aa41a7247f149962327e0bb4833f2a2e68f Mon Sep 17 00:00:00 2001
From: einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Tue, 31 Oct 2006 05:42:52 +0000
Subject: Moving Pg-upgrade* into sql/legacy directory

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@420 4979c152-3d1c-0410-bac9-87ea11338e46
---
 sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql

(limited to 'sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql')

diff --git a/sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql b/sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql
new file mode 100755
index 00000000..908ad198
--- /dev/null
+++ b/sql/legacy/Pg-upgrade-2.6.12-2.6.17.sql
@@ -0,0 +1,19 @@
+CREATE SEQUENCE session_session_id_seq;
+
+CREATE TABLE session(
+session_id INTEGER PRIMARY KEY DEFAULT nextval('session_session_id_seq'),
+sl_login VARCHAR(50),
+token CHAR(32),
+last_used TIMESTAMP default now()
+);
+
+-- LOCK TABLE acc_trans;
+ALTER TABLE acc_trans ALTER COLUMN chart_id SET NOT NULL;
+
+-- For older versions pre 8.0.3
+ALTER TABLE acc_trans ADD COLUMN amount2 NUMERIC;
+UPDATE acc_trans set amount2 = amount;
+ALTER TABLE acc_trans DROP COLUMN amount;
+ALTER TABLE acc_trans RENAME column amount2 TO amount;
+
+UPDATE defaults SET version = '2.6.17';
-- 
cgit v1.2.3

