From: G. Richardson Date: Sun, 7 Aug 2016 20:57:44 +0000 (+0200) Subject: Makemodel make mit Lieferant per Fremdschlüssel verknüpft X-Git-Tag: release-3.5.4~1896 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=36922218f4d6e25152d06d6fa44ed94360e284ab;p=kivitendo-erp.git Makemodel make mit Lieferant per Fremdschlüssel verknüpft --- diff --git a/SL/DB/MetaSetup/MakeModel.pm b/SL/DB/MetaSetup/MakeModel.pm index 6ec58a2f0..e13461a6d 100644 --- a/SL/DB/MetaSetup/MakeModel.pm +++ b/SL/DB/MetaSetup/MakeModel.pm @@ -24,5 +24,12 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); +__PACKAGE__->meta->foreign_keys( + vendor => { + class => 'SL::DB::Vendor', + key_columns => { make => 'id' }, + }, +); + 1; ; diff --git a/sql/Pg-upgrade2/makemodel_add_vendor_foreign_key.sql b/sql/Pg-upgrade2/makemodel_add_vendor_foreign_key.sql new file mode 100644 index 000000000..85d60ceff --- /dev/null +++ b/sql/Pg-upgrade2/makemodel_add_vendor_foreign_key.sql @@ -0,0 +1,6 @@ +-- @tag: makemodel_add_vendor_foreign_key +-- @description: Makemodel make mit Lieferant verknüpft +-- @depends: release_3_4_1 +-- @ignore: 0 + +ALTER TABLE makemodel ADD FOREIGN KEY (make) REFERENCES vendor(id);