Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/AccTransaction.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'acc_trans', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
acc_trans_id => { type => 'bigint', not_null => 1, sequence => 'acc_trans_id_seq' }, |
|
14 |
trans_id => { type => 'integer', not_null => 1 }, |
|
15 |
chart_id => { type => 'integer', not_null => 1 }, |
|
16 |
amount => { type => 'numeric', precision => 5, scale => 15 }, |
|
17 |
transdate => { type => 'date', default => 'now' }, |
|
18 |
gldate => { type => 'date', default => 'now' }, |
|
19 |
source => { type => 'text' }, |
|
20 |
cleared => { type => 'boolean', default => 'false', not_null => 1 }, |
|
21 |
fx_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
22 |
ob_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
23 |
cb_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
24 |
project_id => { type => 'integer' }, |
|
25 |
memo => { type => 'text' }, |
|
26 |
taxkey => { type => 'integer' }, |
|
27 |
itime => { type => 'timestamp', default => 'now()' }, |
|
28 |
mtime => { type => 'timestamp' }, |
|
29 |
tax_id => { type => 'integer', not_null => 1 }, |
|
30 |
chart_link => { type => 'text', not_null => 1 }, |
|
31 |
], |
|
32 |
|
|
33 |
primary_key_columns => [ 'acc_trans_id' ], |
|
34 |
|
|
35 |
allow_inline_column_values => 1, |
|
36 |
|
|
37 |
foreign_keys => [ |
|
38 |
chart => { |
|
39 |
class => 'SL::DB::Chart', |
|
40 |
key_columns => { chart_id => 'id' }, |
|
41 |
}, |
|
42 |
|
|
43 |
project => { |
|
44 |
class => 'SL::DB::Project', |
|
45 |
key_columns => { project_id => 'id' }, |
|
46 |
}, |
|
47 |
|
|
48 |
tax => { |
|
49 |
class => 'SL::DB::Tax', |
|
50 |
key_columns => { tax_id => 'id' }, |
|
51 |
}, |
|
52 |
], |
|
9 |
__PACKAGE__->meta->table('acc_trans'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
acc_trans_id => { type => 'bigint', not_null => 1, sequence => 'acc_trans_id_seq' }, |
|
13 |
trans_id => { type => 'integer', not_null => 1 }, |
|
14 |
chart_id => { type => 'integer', not_null => 1 }, |
|
15 |
amount => { type => 'numeric', precision => 5, scale => 15 }, |
|
16 |
transdate => { type => 'date', default => 'now' }, |
|
17 |
gldate => { type => 'date', default => 'now' }, |
|
18 |
source => { type => 'text' }, |
|
19 |
cleared => { type => 'boolean', default => 'false', not_null => 1 }, |
|
20 |
fx_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
21 |
ob_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
22 |
cb_transaction => { type => 'boolean', default => 'false', not_null => 1 }, |
|
23 |
project_id => { type => 'integer' }, |
|
24 |
memo => { type => 'text' }, |
|
25 |
taxkey => { type => 'integer' }, |
|
26 |
itime => { type => 'timestamp', default => 'now()' }, |
|
27 |
mtime => { type => 'timestamp' }, |
|
28 |
tax_id => { type => 'integer', not_null => 1 }, |
|
29 |
chart_link => { type => 'text', not_null => 1 }, |
|
53 | 30 |
); |
54 | 31 |
|
32 |
__PACKAGE__->meta->primary_key_columns([ 'acc_trans_id' ]); |
|
33 |
|
|
34 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
35 |
|
|
36 |
__PACKAGE__->meta->foreign_keys( |
|
37 |
chart => { |
|
38 |
class => 'SL::DB::Chart', |
|
39 |
key_columns => { chart_id => 'id' }, |
|
40 |
}, |
|
41 |
|
|
42 |
project => { |
|
43 |
class => 'SL::DB::Project', |
|
44 |
key_columns => { project_id => 'id' }, |
|
45 |
}, |
|
46 |
|
|
47 |
tax => { |
|
48 |
class => 'SL::DB::Tax', |
|
49 |
key_columns => { tax_id => 'id' }, |
|
50 |
}, |
|
51 |
); |
|
52 |
|
|
53 |
# __PACKAGE__->meta->initialize; |
|
54 |
|
|
55 | 55 |
1; |
56 | 56 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert