diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-06 01:35:12 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-06 01:35:12 +0000 |
commit | b5b2ab00cbd98adc87e1f6d6c795e77f361a75e4 (patch) | |
tree | 271534934182a0b9fd28d2c403f96b2bf7e0ef8c | |
parent | 6c689187c0d8cf8a78ecfcd8786441ad73c83c11 (diff) |
Fixed db update
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@27 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-x | sql/Pg-upgrade-2.6.12-2.6.16.sql | 11 | ||||
-rwxr-xr-x | sql/Pg-upgrade-2.6.12-2.6.17.sql | 19 |
2 files changed, 19 insertions, 11 deletions
diff --git a/sql/Pg-upgrade-2.6.12-2.6.16.sql b/sql/Pg-upgrade-2.6.12-2.6.16.sql deleted file mode 100755 index aaf49e91..00000000 --- a/sql/Pg-upgrade-2.6.12-2.6.16.sql +++ /dev/null @@ -1,11 +0,0 @@ - -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() -); - -ALTER TABLE acc_trans ALTER COLUMN chart_id SET NOT NULL; diff --git a/sql/Pg-upgrade-2.6.12-2.6.17.sql b/sql/Pg-upgrade-2.6.12-2.6.17.sql new file mode 100755 index 00000000..908ad198 --- /dev/null +++ b/sql/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'; |