From 68399771603d9a2d084a9eaca480f17016801fe6 Mon Sep 17 00:00:00 2001
From: tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Sun, 8 Oct 2006 20:47:38 +0000
Subject: First round of tax code replacement, adds cumulative tax support

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@195 4979c152-3d1c-0410-bac9-87ea11338e46
---
 sql/Pg-upgrade-2.6.18-2.6.19.sql | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to 'sql/Pg-upgrade-2.6.18-2.6.19.sql')

diff --git a/sql/Pg-upgrade-2.6.18-2.6.19.sql b/sql/Pg-upgrade-2.6.18-2.6.19.sql
index 07541bde..d8e304f3 100644
--- a/sql/Pg-upgrade-2.6.18-2.6.19.sql
+++ b/sql/Pg-upgrade-2.6.18-2.6.19.sql
@@ -120,3 +120,23 @@ SET DEFAULT nextval('shipto_entry_id_seq');
 
 UPDATE shipto SET entry_id = nextval('shipto_entry_id_seq');
 ALTER TABLE shipto ADD PRIMARY KEY (entry_id);
+
+CREATE TABLE taxmodule (
+  taxmodule_id serial PRIMARY KEY,
+  taxmodulename text NOT NULL
+);
+
+INSERT INTO taxmodule (
+  taxmodule_id, taxmodulename
+  ) VALUES (
+  1, 'Simple'
+);
+
+LOCK tax IN EXCLUSIVE MODE;
+ALTER TABLE tax ADD COLUMN pass int DEFAULT 0;
+UPDATE tax SET pass = 0;
+ALTER TABLE tax ALTER COLUMN pass SET NOT NULL;
+
+ALTER TABLE tax ADD COLUMN taxmodule_id int REFERENCES taxmodule DEFAULT 1;
+UPDATE tax SET taxmodule_id = 1;
+ALTER TABLE tax ALTER COLUMN taxmodule_id SET NOT NULL;
-- 
cgit v1.2.3

