6e05737df11cd86d8320b700458f48ab7d1de76f
[kivitendo-erp.git] / SL / DB / MetaSetup / Unit.pm
1 # This file has been auto-generated. Do not modify it; it will be overwritten
2 # by rose_auto_create_model.pl automatically.
3 package SL::DB::Unit;
4
5 use strict;
6
7 use base qw(SL::DB::Object);
8
9 __PACKAGE__->meta->setup(
10   table   => 'units',
11
12   columns => [
13     name      => { type => 'varchar', length => 20, not_null => 1 },
14     base_unit => { type => 'varchar', length => 20 },
15     factor    => { type => 'numeric', precision => 5, scale => 20 },
16     type      => { type => 'varchar', length => 20 },
17     sortkey   => { type => 'integer', not_null => 1 },
18     id        => { type => 'serial', not_null => 1 },
19   ],
20
21   primary_key_columns => [ 'name' ],
22
23   unique_key => [ 'id' ],
24
25   foreign_keys => [
26     unit => {
27       class       => 'SL::DB::Unit',
28       key_columns => { base_unit => 'name' },
29     },
30   ],
31 );
32
33 1;
34 ;