Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/AuthClientGroup.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'clients_groups', |
|
11 |
schema => 'auth', |
|
12 |
|
|
13 |
columns => [ |
|
14 |
client_id => { type => 'integer', not_null => 1 }, |
|
15 |
group_id => { type => 'integer', not_null => 1 }, |
|
16 |
], |
|
17 |
|
|
18 |
primary_key_columns => [ 'client_id', 'group_id' ], |
|
19 |
|
|
20 |
foreign_keys => [ |
|
21 |
client => { |
|
22 |
class => 'SL::DB::AuthClient', |
|
23 |
key_columns => { client_id => 'id' }, |
|
24 |
}, |
|
25 |
|
|
26 |
group => { |
|
27 |
class => 'SL::DB::AuthGroup', |
|
28 |
key_columns => { group_id => 'id' }, |
|
29 |
}, |
|
30 |
], |
|
9 |
__PACKAGE__->meta->table('clients_groups'); |
|
10 |
__PACKAGE__->meta->schema('auth'); |
|
11 |
|
|
12 |
__PACKAGE__->meta->columns( |
|
13 |
client_id => { type => 'integer', not_null => 1 }, |
|
14 |
group_id => { type => 'integer', not_null => 1 }, |
|
15 |
); |
|
16 |
|
|
17 |
__PACKAGE__->meta->primary_key_columns([ 'client_id', 'group_id' ]); |
|
18 |
|
|
19 |
__PACKAGE__->meta->foreign_keys( |
|
20 |
client => { |
|
21 |
class => 'SL::DB::AuthClient', |
|
22 |
key_columns => { client_id => 'id' }, |
|
23 |
}, |
|
24 |
|
|
25 |
group => { |
|
26 |
class => 'SL::DB::AuthGroup', |
|
27 |
key_columns => { group_id => 'id' }, |
|
28 |
}, |
|
31 | 29 |
); |
32 | 30 |
|
31 |
# __PACKAGE__->meta->initialize; |
|
32 |
|
|
33 | 33 |
1; |
34 | 34 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert