epic-ts
[kivitendo-erp.git] / sql / Pg-upgrade2 / history_erp.sql
1 -- @tag: history_erp
2 -- @description: Entfernen der Spalten in Tabelle status zum Speichern der history und dafür eigene Tabelle für die history
3 -- @depends: status_history
4 ALTER TABLE status DROP COLUMN id;
5 ALTER TABLE status DROP COLUMN employee_id;
6 ALTER TABLE status DROP COLUMN addition;
7 ALTER TABLE status DROP COLUMN what_done;
8
9 CREATE TABLE history_erp (
10        id integer NOT NULL DEFAULT nextval('id'),
11        trans_id integer,
12        employee_id integer,
13        addition text,
14        what_done text,
15        itime timestamp DEFAULT now(),
16
17        PRIMARY KEY (id),
18        FOREIGN KEY (employee_id) REFERENCES employee (id)
19 );