X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2/letter_cleanup.sql diff --git a/sql/Pg-upgrade2/letter_cleanup.sql b/sql/Pg-upgrade2/letter_cleanup.sql new file mode 100644 index 000000000..e87f6e028 --- /dev/null +++ b/sql/Pg-upgrade2/letter_cleanup.sql @@ -0,0 +1,40 @@ +-- @tag: letter_cleanup +-- @description: Tabelle »letter«: Unbenutzte Spalten entfernen und andere Spalten umbenennen +-- @depends: release_3_4_0 + +ALTER TABLE letter RENAME COLUMN vc_id TO customer_id; +ALTER TABLE letter_draft RENAME COLUMN vc_id TO customer_id; + +ALTER TABLE letter + DROP COLUMN close, + DROP COLUMN company_name, + DROP COLUMN employee_position, + DROP COLUMN jobnumber, + DROP COLUMN page_created_for, + DROP COLUMN rcv_address, + DROP COLUMN rcv_city, + DROP COLUMN rcv_contact, + DROP COLUMN rcv_country, + DROP COLUMN rcv_countrycode, + DROP COLUMN rcv_name, + DROP COLUMN rcv_zipcode, + DROP COLUMN salesman_position, + DROP COLUMN text_created_for, + ADD FOREIGN KEY (customer_id) REFERENCES customer (id); + +ALTER TABLE letter_draft + DROP COLUMN close, + DROP COLUMN company_name, + DROP COLUMN employee_position, + DROP COLUMN jobnumber, + DROP COLUMN page_created_for, + DROP COLUMN rcv_address, + DROP COLUMN rcv_city, + DROP COLUMN rcv_contact, + DROP COLUMN rcv_country, + DROP COLUMN rcv_countrycode, + DROP COLUMN rcv_name, + DROP COLUMN rcv_zipcode, + DROP COLUMN salesman_position, + DROP COLUMN text_created_for, + ADD FOREIGN KEY (customer_id) REFERENCES customer (id);