Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/Exchangerate.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'exchangerate', |
|
11 |
|
|
12 |
columns => [ |
|
13 |
transdate => { type => 'date' }, |
|
14 |
buy => { type => 'numeric', precision => 5, scale => 15 }, |
|
15 |
sell => { type => 'numeric', precision => 5, scale => 15 }, |
|
16 |
itime => { type => 'timestamp', default => 'now()' }, |
|
17 |
mtime => { type => 'timestamp' }, |
|
18 |
id => { type => 'serial', not_null => 1 }, |
|
19 |
currency_id => { type => 'integer', not_null => 1 }, |
|
20 |
], |
|
21 |
|
|
22 |
primary_key_columns => [ 'id' ], |
|
23 |
|
|
24 |
allow_inline_column_values => 1, |
|
25 |
|
|
26 |
foreign_keys => [ |
|
27 |
currency => { |
|
28 |
class => 'SL::DB::Currency', |
|
29 |
key_columns => { currency_id => 'id' }, |
|
30 |
}, |
|
31 |
], |
|
9 |
__PACKAGE__->meta->table('exchangerate'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
transdate => { type => 'date' }, |
|
13 |
buy => { type => 'numeric', precision => 5, scale => 15 }, |
|
14 |
sell => { type => 'numeric', precision => 5, scale => 15 }, |
|
15 |
itime => { type => 'timestamp', default => 'now()' }, |
|
16 |
mtime => { type => 'timestamp' }, |
|
17 |
id => { type => 'serial', not_null => 1 }, |
|
18 |
currency_id => { type => 'integer', not_null => 1 }, |
|
32 | 19 |
); |
33 | 20 |
|
21 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
22 |
|
|
23 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
24 |
|
|
25 |
__PACKAGE__->meta->foreign_keys( |
|
26 |
currency => { |
|
27 |
class => 'SL::DB::Currency', |
|
28 |
key_columns => { currency_id => 'id' }, |
|
29 |
}, |
|
30 |
); |
|
31 |
|
|
32 |
# __PACKAGE__->meta->initialize; |
|
33 |
|
|
34 | 34 |
1; |
35 | 35 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert