Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/AuthClient.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'clients', |
|
11 |
schema => 'auth', |
|
12 |
|
|
13 |
columns => [ |
|
14 |
id => { type => 'serial', not_null => 1 }, |
|
15 |
name => { type => 'text', not_null => 1 }, |
|
16 |
dbhost => { type => 'text', not_null => 1 }, |
|
17 |
dbport => { type => 'integer', default => 5432, not_null => 1 }, |
|
18 |
dbname => { type => 'text', not_null => 1 }, |
|
19 |
dbuser => { type => 'text', not_null => 1 }, |
|
20 |
dbpasswd => { type => 'text', not_null => 1 }, |
|
21 |
is_default => { type => 'boolean', default => 'false', not_null => 1 }, |
|
22 |
], |
|
23 |
|
|
24 |
primary_key_columns => [ 'id' ], |
|
25 |
|
|
26 |
unique_keys => [ |
|
27 |
[ 'dbhost', 'dbport', 'dbname' ], |
|
28 |
[ 'name' ], |
|
29 |
], |
|
9 |
__PACKAGE__->meta->table('clients'); |
|
10 |
__PACKAGE__->meta->schema('auth'); |
|
11 |
|
|
12 |
__PACKAGE__->meta->columns( |
|
13 |
id => { type => 'serial', not_null => 1 }, |
|
14 |
name => { type => 'text', not_null => 1 }, |
|
15 |
dbhost => { type => 'text', not_null => 1 }, |
|
16 |
dbport => { type => 'integer', default => 5432, not_null => 1 }, |
|
17 |
dbname => { type => 'text', not_null => 1 }, |
|
18 |
dbuser => { type => 'text', not_null => 1 }, |
|
19 |
dbpasswd => { type => 'text', not_null => 1 }, |
|
20 |
is_default => { type => 'boolean', default => 'false', not_null => 1 }, |
|
30 | 21 |
); |
31 | 22 |
|
23 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
24 |
|
|
25 |
__PACKAGE__->meta->unique_keys( |
|
26 |
[ 'dbhost', 'dbport', 'dbname' ], |
|
27 |
[ 'name' ], |
|
28 |
); |
|
29 |
|
|
30 |
# __PACKAGE__->meta->initialize; |
|
31 |
|
|
32 | 32 |
1; |
33 | 33 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert