From: G. Richardson Date: Sat, 30 Jul 2016 07:38:46 +0000 (+0200) Subject: Tabelle parts: Fremdschlüssel für Konten X-Git-Tag: release-3.5.4~2166 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fc893a6d57c085228f56e272f6b144c3d6ea5393;p=kivitendo-erp.git Tabelle parts: Fremdschlüssel für Konten --- 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);