Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/AuthUserGroup.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'user_group', |
|
11 |
schema => 'auth', |
|
12 |
|
|
13 |
columns => [ |
|
14 |
user_id => { type => 'integer', not_null => 1 }, |
|
15 |
group_id => { type => 'integer', not_null => 1 }, |
|
16 |
], |
|
17 |
|
|
18 |
primary_key_columns => [ 'user_id', 'group_id' ], |
|
19 |
|
|
20 |
foreign_keys => [ |
|
21 |
group => { |
|
22 |
class => 'SL::DB::AuthGroup', |
|
23 |
key_columns => { group_id => 'id' }, |
|
24 |
}, |
|
25 |
|
|
26 |
user => { |
|
27 |
class => 'SL::DB::AuthUser', |
|
28 |
key_columns => { user_id => 'id' }, |
|
29 |
}, |
|
30 |
], |
|
9 |
__PACKAGE__->meta->table('user_group'); |
|
10 |
__PACKAGE__->meta->schema('auth'); |
|
11 |
|
|
12 |
__PACKAGE__->meta->columns( |
|
13 |
user_id => { type => 'integer', not_null => 1 }, |
|
14 |
group_id => { type => 'integer', not_null => 1 }, |
|
15 |
); |
|
16 |
|
|
17 |
__PACKAGE__->meta->primary_key_columns([ 'user_id', 'group_id' ]); |
|
18 |
|
|
19 |
__PACKAGE__->meta->foreign_keys( |
|
20 |
group => { |
|
21 |
class => 'SL::DB::AuthGroup', |
|
22 |
key_columns => { group_id => 'id' }, |
|
23 |
}, |
|
24 |
|
|
25 |
user => { |
|
26 |
class => 'SL::DB::AuthUser', |
|
27 |
key_columns => { user_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