From 3c22e5f4b953f463a33b722d6f4f122e4a20c99a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 29 Apr 2021 11:22:13 +0200 Subject: [PATCH] =?utf8?q?Zeiterfassung:=20Fremdschl=C3=BCssel=20f=C3=BCr?= =?utf8?q?=20Auftrag:=20DB-Upgrade=20und=20Rose?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/MetaSetup/TimeRecording.pm | 6 ++++++ sql/Pg-upgrade2/time_recordings_add_order.sql | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 sql/Pg-upgrade2/time_recordings_add_order.sql diff --git a/SL/DB/MetaSetup/TimeRecording.pm b/SL/DB/MetaSetup/TimeRecording.pm index 0ab79a551..a5001312d 100644 --- a/SL/DB/MetaSetup/TimeRecording.pm +++ b/SL/DB/MetaSetup/TimeRecording.pm @@ -19,6 +19,7 @@ __PACKAGE__->meta->columns( id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()', not_null => 1 }, mtime => { type => 'timestamp', default => 'now()', not_null => 1 }, + order_id => { type => 'integer' }, part_id => { type => 'integer' }, payroll => { type => 'boolean', default => 'false' }, project_id => { type => 'integer' }, @@ -41,6 +42,11 @@ __PACKAGE__->meta->foreign_keys( key_columns => { employee_id => 'id' }, }, + order => { + class => 'SL::DB::Order', + key_columns => { order_id => 'id' }, + }, + part => { class => 'SL::DB::Part', key_columns => { part_id => 'id' }, diff --git a/sql/Pg-upgrade2/time_recordings_add_order.sql b/sql/Pg-upgrade2/time_recordings_add_order.sql new file mode 100644 index 000000000..a9b1a0d9a --- /dev/null +++ b/sql/Pg-upgrade2/time_recordings_add_order.sql @@ -0,0 +1,5 @@ +-- @tag: time_recordings_add_order +-- @description: Erweiterung Zeiterfassung um Fremdschlüssel zu Auftrag +-- @depends: time_recordings_date_duration + +ALTER TABLE time_recordings ADD COLUMN order_id INTEGER REFERENCES oe (id); -- 2.20.1