Revision b8b112a3
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/DB/MetaSetup/Customer.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use base qw(SL::DB::Object); |
8 | 8 |
|
9 |
__PACKAGE__->meta->setup( |
|
10 |
table => 'customer', |
|
9 |
__PACKAGE__->meta->table('customer'); |
|
11 | 10 |
|
12 |
columns => [ |
|
13 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
14 |
name => { type => 'text', not_null => 1 }, |
|
15 |
department_1 => { type => 'varchar', length => 75 }, |
|
16 |
department_2 => { type => 'varchar', length => 75 }, |
|
17 |
street => { type => 'varchar', length => 75 }, |
|
18 |
zipcode => { type => 'varchar', length => 10 }, |
|
19 |
city => { type => 'varchar', length => 75 }, |
|
20 |
country => { type => 'varchar', length => 75 }, |
|
21 |
contact => { type => 'text' }, |
|
22 |
phone => { type => 'text' }, |
|
23 |
fax => { type => 'varchar', length => 30 }, |
|
24 |
homepage => { type => 'text' }, |
|
25 |
email => { type => 'text' }, |
|
26 |
notes => { type => 'text' }, |
|
27 |
discount => { type => 'float', precision => 4 }, |
|
28 |
taxincluded => { type => 'boolean' }, |
|
29 |
creditlimit => { type => 'numeric', default => '0', precision => 5, scale => 15 }, |
|
30 |
terms => { type => 'integer', default => '0' }, |
|
31 |
customernumber => { type => 'text' }, |
|
32 |
cc => { type => 'text' }, |
|
33 |
bcc => { type => 'text' }, |
|
34 |
business_id => { type => 'integer' }, |
|
35 |
taxnumber => { type => 'text' }, |
|
36 |
account_number => { type => 'text' }, |
|
37 |
bank_code => { type => 'text' }, |
|
38 |
bank => { type => 'text' }, |
|
39 |
language => { type => 'varchar', length => 5 }, |
|
40 |
itime => { type => 'timestamp', default => 'now()' }, |
|
41 |
mtime => { type => 'timestamp' }, |
|
42 |
obsolete => { type => 'boolean', default => 'false' }, |
|
43 |
username => { type => 'varchar', length => 50 }, |
|
44 |
user_password => { type => 'text' }, |
|
45 |
salesman_id => { type => 'integer' }, |
|
46 |
c_vendor_id => { type => 'text' }, |
|
47 |
klass => { type => 'integer', default => '0' }, |
|
48 |
language_id => { type => 'integer' }, |
|
49 |
payment_id => { type => 'integer' }, |
|
50 |
taxzone_id => { type => 'integer', default => '0', not_null => 1 }, |
|
51 |
greeting => { type => 'text' }, |
|
52 |
ustid => { type => 'text' }, |
|
53 |
iban => { type => 'varchar', length => 100 }, |
|
54 |
bic => { type => 'varchar', length => 100 }, |
|
55 |
direct_debit => { type => 'boolean', default => 'false' }, |
|
56 |
taxincluded_checked => { type => 'boolean' }, |
|
57 |
currency_id => { type => 'integer', not_null => 1 }, |
|
58 |
], |
|
59 |
|
|
60 |
primary_key_columns => [ 'id' ], |
|
61 |
|
|
62 |
allow_inline_column_values => 1, |
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
13 |
name => { type => 'text', not_null => 1 }, |
|
14 |
department_1 => { type => 'varchar', length => 75 }, |
|
15 |
department_2 => { type => 'varchar', length => 75 }, |
|
16 |
street => { type => 'varchar', length => 75 }, |
|
17 |
zipcode => { type => 'varchar', length => 10 }, |
|
18 |
city => { type => 'varchar', length => 75 }, |
|
19 |
country => { type => 'varchar', length => 75 }, |
|
20 |
contact => { type => 'text' }, |
|
21 |
phone => { type => 'text' }, |
|
22 |
fax => { type => 'varchar', length => 30 }, |
|
23 |
homepage => { type => 'text' }, |
|
24 |
email => { type => 'text' }, |
|
25 |
notes => { type => 'text' }, |
|
26 |
discount => { type => 'float', precision => 4 }, |
|
27 |
taxincluded => { type => 'boolean' }, |
|
28 |
creditlimit => { type => 'numeric', default => '0', precision => 5, scale => 15 }, |
|
29 |
terms => { type => 'integer', default => '0' }, |
|
30 |
customernumber => { type => 'text' }, |
|
31 |
cc => { type => 'text' }, |
|
32 |
bcc => { type => 'text' }, |
|
33 |
business_id => { type => 'integer' }, |
|
34 |
taxnumber => { type => 'text' }, |
|
35 |
account_number => { type => 'text' }, |
|
36 |
bank_code => { type => 'text' }, |
|
37 |
bank => { type => 'text' }, |
|
38 |
language => { type => 'varchar', length => 5 }, |
|
39 |
itime => { type => 'timestamp', default => 'now()' }, |
|
40 |
mtime => { type => 'timestamp' }, |
|
41 |
obsolete => { type => 'boolean', default => 'false' }, |
|
42 |
username => { type => 'varchar', length => 50 }, |
|
43 |
user_password => { type => 'text' }, |
|
44 |
salesman_id => { type => 'integer' }, |
|
45 |
c_vendor_id => { type => 'text' }, |
|
46 |
klass => { type => 'integer', default => '0' }, |
|
47 |
language_id => { type => 'integer' }, |
|
48 |
payment_id => { type => 'integer' }, |
|
49 |
taxzone_id => { type => 'integer', default => '0', not_null => 1 }, |
|
50 |
greeting => { type => 'text' }, |
|
51 |
ustid => { type => 'text' }, |
|
52 |
direct_debit => { type => 'boolean', default => 'false' }, |
|
53 |
iban => { type => 'varchar', length => 100 }, |
|
54 |
bic => { type => 'varchar', length => 100 }, |
|
55 |
taxincluded_checked => { type => 'boolean' }, |
|
56 |
currency_id => { type => 'integer', not_null => 1 }, |
|
57 |
); |
|
63 | 58 |
|
64 |
foreign_keys => [ |
|
65 |
business => { |
|
66 |
class => 'SL::DB::Business', |
|
67 |
key_columns => { business_id => 'id' }, |
|
68 |
}, |
|
59 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
69 | 60 |
|
70 |
currency => { |
|
71 |
class => 'SL::DB::Currency', |
|
72 |
key_columns => { currency_id => 'id' }, |
|
73 |
}, |
|
61 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
74 | 62 |
|
75 |
language_obj => { |
|
76 |
class => 'SL::DB::Language', |
|
77 |
key_columns => { language_id => 'id' }, |
|
78 |
}, |
|
63 |
__PACKAGE__->meta->foreign_keys( |
|
64 |
business => { |
|
65 |
class => 'SL::DB::Business', |
|
66 |
key_columns => { business_id => 'id' }, |
|
67 |
}, |
|
79 | 68 |
|
80 |
payment => { |
|
81 |
class => 'SL::DB::PaymentTerm', |
|
82 |
key_columns => { payment_id => 'id' }, |
|
83 |
}, |
|
84 |
], |
|
69 |
currency => { |
|
70 |
class => 'SL::DB::Currency', |
|
71 |
key_columns => { currency_id => 'id' }, |
|
72 |
}, |
|
85 | 73 |
); |
86 | 74 |
|
75 |
# __PACKAGE__->meta->initialize; |
|
76 |
|
|
87 | 77 |
1; |
88 | 78 |
; |
Auch abrufbar als: Unified diff
MetaSetup neu generiert