Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/TaxKey.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'taxkeys', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
14 |
chart_id => { type => 'integer', not_null => 1 }, |
|
15 |
tax_id => { type => 'integer', not_null => 1 }, |
|
16 |
taxkey_id => { type => 'integer', not_null => 1 }, |
|
17 |
pos_ustva => { type => 'integer' }, |
|
18 |
startdate => { type => 'date', not_null => 1 }, |
|
19 |
], |
|
20 |
|
|
21 |
primary_key_columns => [ 'id' ], |
|
22 |
|
|
23 |
unique_key => [ 'chart_id', 'startdate' ], |
|
24 |
|
|
25 |
foreign_keys => [ |
|
26 |
chart => { |
|
27 |
class => 'SL::DB::Chart', |
|
28 |
key_columns => { chart_id => 'id' }, |
|
29 |
}, |
|
30 |
|
|
31 |
tax => { |
|
32 |
class => 'SL::DB::Tax', |
|
33 |
key_columns => { tax_id => 'id' }, |
|
34 |
}, |
|
35 |
], |
|
9 |
__PACKAGE__->meta->table('taxkeys'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
13 |
chart_id => { type => 'integer', not_null => 1 }, |
|
14 |
tax_id => { type => 'integer', not_null => 1 }, |
|
15 |
taxkey_id => { type => 'integer', not_null => 1 }, |
|
16 |
pos_ustva => { type => 'integer' }, |
|
17 |
startdate => { type => 'date', not_null => 1 }, |
|
36 | 18 |
); |
37 | 19 |
|
20 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
21 |
|
|
22 |
__PACKAGE__->meta->unique_keys([ 'chart_id', 'startdate' ]); |
|
23 |
|
|
24 |
__PACKAGE__->meta->foreign_keys( |
|
25 |
chart => { |
|
26 |
class => 'SL::DB::Chart', |
|
27 |
key_columns => { chart_id => 'id' }, |
|
28 |
}, |
|
29 |
|
|
30 |
tax => { |
|
31 |
class => 'SL::DB::Tax', |
|
32 |
key_columns => { tax_id => 'id' }, |
|
33 |
}, |
|
34 |
); |
|
35 |
|
|
36 |
# __PACKAGE__->meta->initialize; |
|
37 |
|
|
38 | 38 |
1; |
39 | 39 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert