X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FMetaSetup%2FPrice.pm;h=a0c26391f9752c0f7fd944c82efa35d49e22b929;hb=405928eb48c94072a7de854f682853a8971b7eb4;hp=bb6f0fd388973bc8444ca3da15fbf48acf963ee8;hpb=0bf9f21482c4581f8cea90cc8d847f876682302f;p=kivitendo-erp.git diff --git a/SL/DB/MetaSetup/Price.pm b/SL/DB/MetaSetup/Price.pm index bb6f0fd38..a0c26391f 100644 --- a/SL/DB/MetaSetup/Price.pm +++ b/SL/DB/MetaSetup/Price.pm @@ -4,31 +4,31 @@ package SL::DB::Price; use strict; -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'prices', - - columns => [ - parts_id => { type => 'integer' }, - pricegroup_id => { type => 'integer' }, - price => { type => 'numeric', precision => 5, scale => 15 }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], - - foreign_keys => [ - parts => { - class => 'SL::DB::Part', - key_columns => { parts_id => 'id' }, - }, - - pricegroup => { - class => 'SL::DB::Pricegroup', - key_columns => { pricegroup_id => 'id' }, - }, - ], +use parent qw(SL::DB::Object); + +__PACKAGE__->meta->table('prices'); + +__PACKAGE__->meta->columns( + id => { type => 'serial', not_null => 1 }, + parts_id => { type => 'integer', not_null => 1 }, + price => { type => 'numeric', precision => 15, scale => 5 }, + pricegroup_id => { type => 'integer', not_null => 1 }, +); + +__PACKAGE__->meta->primary_key_columns([ 'id' ]); + +__PACKAGE__->meta->unique_keys([ 'parts_id', 'pricegroup_id' ]); + +__PACKAGE__->meta->foreign_keys( + parts => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + + pricegroup => { + class => 'SL::DB::Pricegroup', + key_columns => { pricegroup_id => 'id' }, + }, ); 1;