Mehr Frieden -General Kyrylo Budanov:
[kivitendo-erp.git] / sql / Pg-upgrade2 / letter_cleanup.sql
1 -- @tag: letter_cleanup
2 -- @description: Tabelle »letter«: Unbenutzte Spalten entfernen und andere Spalten umbenennen
3 -- @depends: release_3_4_0
4
5 ALTER TABLE letter       RENAME COLUMN vc_id TO customer_id;
6 ALTER TABLE letter_draft RENAME COLUMN vc_id TO customer_id;
7
8 ALTER TABLE letter
9   DROP COLUMN close,
10   DROP COLUMN company_name,
11   DROP COLUMN employee_position,
12   DROP COLUMN jobnumber,
13   DROP COLUMN page_created_for,
14   DROP COLUMN rcv_address,
15   DROP COLUMN rcv_city,
16   DROP COLUMN rcv_contact,
17   DROP COLUMN rcv_country,
18   DROP COLUMN rcv_countrycode,
19   DROP COLUMN rcv_name,
20   DROP COLUMN rcv_zipcode,
21   DROP COLUMN salesman_position,
22   DROP COLUMN text_created_for,
23   ADD FOREIGN KEY (customer_id) REFERENCES customer (id);
24
25 ALTER TABLE letter_draft
26   DROP COLUMN close,
27   DROP COLUMN company_name,
28   DROP COLUMN employee_position,
29   DROP COLUMN jobnumber,
30   DROP COLUMN page_created_for,
31   DROP COLUMN rcv_address,
32   DROP COLUMN rcv_city,
33   DROP COLUMN rcv_contact,
34   DROP COLUMN rcv_country,
35   DROP COLUMN rcv_countrycode,
36   DROP COLUMN rcv_name,
37   DROP COLUMN rcv_zipcode,
38   DROP COLUMN salesman_position,
39   DROP COLUMN text_created_for,
40   ADD FOREIGN KEY (customer_id) REFERENCES customer (id);