Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/Currency.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'currencies', |
|
9 |
__PACKAGE__->meta->table('currencies'); |
|
11 | 10 |
|
12 |
columns => [ |
|
13 |
id => { type => 'serial', not_null => 1 }, |
|
14 |
name => { type => 'text', not_null => 1 }, |
|
15 |
], |
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'serial', not_null => 1 }, |
|
13 |
name => { type => 'text', not_null => 1 }, |
|
14 |
); |
|
15 |
|
|
16 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
16 | 17 |
|
17 |
primary_key_columns => [ 'id' ],
|
|
18 |
__PACKAGE__->meta->unique_keys([ 'name' ]);
|
|
18 | 19 |
|
19 |
unique_key => [ 'name' ], |
|
20 |
__PACKAGE__->meta->relationships( |
|
21 |
ap => { |
|
22 |
class => 'SL::DB::PurchaseInvoice', |
|
23 |
column_map => { id => 'currency_id' }, |
|
24 |
type => 'one to many', |
|
25 |
}, |
|
26 |
|
|
27 |
ar => { |
|
28 |
class => 'SL::DB::Invoice', |
|
29 |
column_map => { id => 'currency_id' }, |
|
30 |
type => 'one to many', |
|
31 |
}, |
|
20 | 32 |
); |
21 | 33 |
|
34 |
# __PACKAGE__->meta->initialize; |
|
35 |
|
|
22 | 36 |
1; |
23 | 37 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert