1 -- @tag: letter_cleanup
2 -- @description: Tabelle »letter«: Unbenutzte Spalten entfernen und andere Spalten umbenennen
3 -- @depends: release_3_4_0
5 ALTER TABLE letter RENAME COLUMN vc_id TO customer_id;
6 ALTER TABLE letter_draft RENAME COLUMN vc_id TO customer_id;
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,
16 DROP COLUMN rcv_contact,
17 DROP COLUMN rcv_country,
18 DROP COLUMN rcv_countrycode,
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);
25 ALTER TABLE letter_draft
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,
33 DROP COLUMN rcv_contact,
34 DROP COLUMN rcv_country,
35 DROP COLUMN rcv_countrycode,
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);