X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/30c9fd203f9285f08501a1f9e985dcd8c3a79715..a9b2cbe24d8c27e71b0683548cf9b358cd5f724b:/sql/Pg-upgrade2/letter.sql

diff --git a/sql/Pg-upgrade2/letter.sql b/sql/Pg-upgrade2/letter.sql
new file mode 100644
index 000000000..6aedbd67d
--- /dev/null
+++ b/sql/Pg-upgrade2/letter.sql
@@ -0,0 +1,41 @@
+-- @tag: letter
+-- @description: Brieffunktion Felder
+-- @depends: release_3_2_0
+
+CREATE TABLE letter (
+  id INTEGER NOT NULL DEFAULT nextval('id'),
+  vc_id INTEGER NOT NULL,
+  rcv_name TEXT,
+  rcv_contact TEXT,
+  rcv_address TEXT,
+  rcv_countrycode TEXT,
+  rcv_zipcode TEXT,
+  rcv_city TEXT,
+
+  letternumber TEXT,
+  jobnumber TEXT,
+  text_created_for TEXT,
+  date TEXT,
+
+  subject TEXT,
+  greeting TEXT,
+  body TEXT,
+  close TEXT,
+  company_name TEXT,
+
+  employee_id INTEGER NOT NULL,
+  employee_position TEXT,
+
+  salesman_id INTEGER NOT NULL,
+  salesman_position TEXT,
+
+  itime TIMESTAMP DEFAULT now(),
+  mtime TIMESTAMP,
+
+  PRIMARY KEY (id),
+  FOREIGN KEY (employee_id) REFERENCES employee (id),
+  FOREIGN KEY (salesman_id) REFERENCES employee (id)
+);
+
+ALTER TABLE defaults ADD COLUMN letternumber integer;
+
