From fc893a6d57c085228f56e272f6b144c3d6ea5393 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Sat, 30 Jul 2016 09:38:46 +0200 Subject: [PATCH] =?utf8?q?Tabelle=20parts:=20Fremdschl=C3=BCssel=20f=C3=BC?= =?utf8?q?r=20Konten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/MetaSetup/Part.pm | 15 +++++++++++++++ sql/Pg-upgrade2/parts_add_chart_foreign_keys.sql | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 sql/Pg-upgrade2/parts_add_chart_foreign_keys.sql diff --git a/SL/DB/MetaSetup/Part.pm b/SL/DB/MetaSetup/Part.pm index 392249d83..c54a8cfc7 100644 --- a/SL/DB/MetaSetup/Part.pm +++ b/SL/DB/MetaSetup/Part.pm @@ -66,6 +66,21 @@ __PACKAGE__->meta->foreign_keys( key_columns => { buchungsgruppen_id => 'id' }, }, + expense_accno => { + class => 'SL::DB::Chart', + key_columns => { expense_accno_id => 'id' }, + }, + + income_accno => { + class => 'SL::DB::Chart', + key_columns => { income_accno_id => 'id' }, + }, + + inventory_accno => { + class => 'SL::DB::Chart', + key_columns => { inventory_accno_id => 'id' }, + }, + partsgroup => { class => 'SL::DB::PartsGroup', key_columns => { partsgroup_id => 'id' }, diff --git a/sql/Pg-upgrade2/parts_add_chart_foreign_keys.sql b/sql/Pg-upgrade2/parts_add_chart_foreign_keys.sql new file mode 100644 index 000000000..97c4ae8e9 --- /dev/null +++ b/sql/Pg-upgrade2/parts_add_chart_foreign_keys.sql @@ -0,0 +1,8 @@ +-- @tag: parts_add_chart_foreign_keys +-- @description: Warenkonten mit chart-Tabelle per Fremdschlüssel verknüpft. +-- @depends: release_3_4_1 +-- @ignore: 0 + +ALTER TABLE parts ADD FOREIGN KEY (income_accno_id) REFERENCES chart(id); +ALTER TABLE parts ADD FOREIGN KEY (inventory_accno_id) REFERENCES chart(id); +ALTER TABLE parts ADD FOREIGN KEY (expense_accno_id) REFERENCES chart(id); -- 2.20.1