Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4bcf8804

Von Sven Schöling vor mehr als 11 Jahren hinzugefügt

  • ID 4bcf880408fcc4270084f36520d4fd2cfd509fbc
  • Vorgänger 2d7e4203
  • Nachfolger 95a60147

MetaSetup: Folgerun um die Foreign Keys umzudrehen

Unterschiede anzeigen:

SL/DB/MetaSetup/Currency.pm
17 17

  
18 18
__PACKAGE__->meta->unique_keys([ 'name' ]);
19 19

  
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
  },
32
);
33

  
34 20
# __PACKAGE__->meta->initialize;
35 21

  
36 22
1;
SL/DB/MetaSetup/Customer.pm
70 70
    class       => 'SL::DB::Currency',
71 71
    key_columns => { currency_id => 'id' },
72 72
  },
73

  
74
  language_obj => {
75
    class       => 'SL::DB::Language',
76
    key_columns => { language_id => 'id' },
77
  },
78

  
79
  payment => {
80
    class       => 'SL::DB::PaymentTerm',
81
    key_columns => { payment_id => 'id' },
82
  },
73 83
);
74 84

  
75 85
# __PACKAGE__->meta->initialize;
SL/DB/MetaSetup/DeliveryOrder.pm
61 61
    key_columns => { customer_id => 'id' },
62 62
  },
63 63

  
64
  department => {
65
    class       => 'SL::DB::Department',
66
    key_columns => { department_id => 'id' },
67
  },
68

  
69
  employee => {
70
    class       => 'SL::DB::Employee',
71
    key_columns => { employee_id => 'id' },
72
  },
73

  
64 74
  globalproject => {
65 75
    class       => 'SL::DB::Project',
66 76
    key_columns => { globalproject_id => 'id' },
67 77
  },
68 78

  
79
  language => {
80
    class       => 'SL::DB::Language',
81
    key_columns => { language_id => 'id' },
82
  },
83

  
84
  salesman => {
85
    class       => 'SL::DB::Employee',
86
    key_columns => { salesman_id => 'id' },
87
  },
88

  
89
  shipto => {
90
    class       => 'SL::DB::Shipto',
91
    key_columns => { shipto_id => 'shipto_id' },
92
  },
93

  
69 94
  vendor => {
70 95
    class       => 'SL::DB::Vendor',
71 96
    key_columns => { vendor_id => 'id' },
SL/DB/MetaSetup/DeliveryOrderItem.pm
44 44
    key_columns => { delivery_order_id => 'id' },
45 45
  },
46 46

  
47
  parts => {
47
  part => {
48 48
    class       => 'SL::DB::Part',
49 49
    key_columns => { parts_id => 'id' },
50 50
  },
51 51

  
52
  price_factor_obj => {
53
    class       => 'SL::DB::PriceFactor',
54
    key_columns => { price_factor_id => 'id' },
55
  },
56

  
57
  pricegroup => {
58
    class       => 'SL::DB::Pricegroup',
59
    key_columns => { pricegroup_id => 'id' },
60
  },
61

  
52 62
  project => {
53 63
    class       => 'SL::DB::Project',
54 64
    key_columns => { project_id => 'id' },
SL/DB/MetaSetup/Department.pm
19 19

  
20 20
__PACKAGE__->meta->allow_inline_column_values(1);
21 21

  
22
__PACKAGE__->meta->relationships(
23
  ap => {
24
    class      => 'SL::DB::PurchaseInvoice',
25
    column_map => { id => 'department_id' },
26
    type       => 'one to many',
27
  },
28

  
29
  ar => {
30
    class      => 'SL::DB::Invoice',
31
    column_map => { id => 'department_id' },
32
    type       => 'one to many',
33
  },
34
);
35

  
36 22
# __PACKAGE__->meta->initialize;
37 23

  
38 24
1;
SL/DB/MetaSetup/Draft.pm
22 22

  
23 23
__PACKAGE__->meta->allow_inline_column_values(1);
24 24

  
25
__PACKAGE__->meta->foreign_keys(
26
  employee => {
27
    class       => 'SL::DB::Employee',
28
    key_columns => { employee_id => 'id' },
29
  },
30
);
31

  
25 32
# __PACKAGE__->meta->initialize;
26 33

  
27 34
1;
SL/DB/MetaSetup/Dunning.pm
28 28
__PACKAGE__->meta->allow_inline_column_values(1);
29 29

  
30 30
__PACKAGE__->meta->foreign_keys(
31
  dunning_config => {
32
    class       => 'SL::DB::DunningConfig',
33
    key_columns => { dunning_config_id => 'id' },
34
  },
35

  
31 36
  fee_interest_ar => {
32 37
    class       => 'SL::DB::Invoice',
33 38
    key_columns => { fee_interest_ar_id => 'id' },
SL/DB/MetaSetup/DunningConfig.pm
28 28

  
29 29
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
30 30

  
31
__PACKAGE__->meta->relationships(
32
  ar => {
33
    class      => 'SL::DB::Invoice',
34
    column_map => { id => 'dunning_config_id' },
35
    type       => 'one to many',
36
  },
37

  
38
  dunning => {
39
    class      => 'SL::DB::Dunning',
40
    column_map => { id => 'dunning_config_id' },
41
    type       => 'one to many',
42
  },
43
);
44

  
45 31
# __PACKAGE__->meta->initialize;
46 32

  
47 33
1;
SL/DB/MetaSetup/Employee.pm
33 33

  
34 34
__PACKAGE__->meta->allow_inline_column_values(1);
35 35

  
36
__PACKAGE__->meta->relationships(
37
  ap => {
38
    class      => 'SL::DB::PurchaseInvoice',
39
    column_map => { id => 'employee_id' },
40
    type       => 'one to many',
41
  },
42

  
43
  ar => {
44
    class      => 'SL::DB::Invoice',
45
    column_map => { id => 'employee_id' },
46
    type       => 'one to many',
47
  },
48

  
49
  ar_objs => {
50
    class      => 'SL::DB::Invoice',
51
    column_map => { id => 'salesman_id' },
52
    type       => 'one to many',
53
  },
54

  
55
  drafts => {
56
    class      => 'SL::DB::Draft',
57
    column_map => { id => 'employee_id' },
58
    type       => 'one to many',
59
  },
60
);
61

  
62 36
# __PACKAGE__->meta->initialize;
63 37

  
64 38
1;
SL/DB/MetaSetup/FollowUp.pm
33 33
    class       => 'SL::DB::Employee',
34 34
    key_columns => { created_by => 'id' },
35 35
  },
36
);
37 36

  
38
__PACKAGE__->meta->relationships(
39
  follow_up_links => {
40
    class      => 'SL::DB::FollowUpLink',
41
    column_map => { id => 'follow_up_id' },
42
    type       => 'one to many',
37
  note => {
38
    class       => 'SL::DB::Note',
39
    key_columns => { note_id => 'id' },
43 40
  },
44 41
);
45 42

  
SL/DB/MetaSetup/FollowUpLink.pm
22 22

  
23 23
__PACKAGE__->meta->allow_inline_column_values(1);
24 24

  
25
__PACKAGE__->meta->foreign_keys(
26
  follow_up => {
27
    class       => 'SL::DB::FollowUp',
28
    key_columns => { follow_up_id => 'id' },
29
  },
30
);
31

  
25 32
# __PACKAGE__->meta->initialize;
26 33

  
27 34
1;
SL/DB/MetaSetup/GLTransaction.pm
43 43
  },
44 44
);
45 45

  
46
__PACKAGE__->meta->relationships(
47
  gl => {
48
    class      => 'SL::DB::GLTransaction',
49
    column_map => { id => 'storno_id' },
50
    type       => 'one to many',
51
  },
52
);
53

  
54 46
# __PACKAGE__->meta->initialize;
55 47

  
56 48
1;
SL/DB/MetaSetup/GenericTranslation.pm
18 18

  
19 19
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
20 20

  
21
__PACKAGE__->meta->foreign_keys(
22
  language => {
23
    class       => 'SL::DB::Language',
24
    key_columns => { language_id => 'id' },
25
  },
26
);
27

  
21 28
# __PACKAGE__->meta->initialize;
22 29

  
23 30
1;
SL/DB/MetaSetup/Invoice.pm
68 68
    key_columns => { cp_id => 'cp_id' },
69 69
  },
70 70

  
71
  currency => {
72
    class       => 'SL::DB::Currency',
73
    key_columns => { currency_id => 'id' },
74
  },
75

  
71 76
  customer => {
72 77
    class       => 'SL::DB::Customer',
73 78
    key_columns => { customer_id => 'id' },
74 79
  },
75 80

  
81
  department => {
82
    class       => 'SL::DB::Department',
83
    key_columns => { department_id => 'id' },
84
  },
85

  
86
  dunning_config => {
87
    class       => 'SL::DB::DunningConfig',
88
    key_columns => { dunning_config_id => 'id' },
89
  },
90

  
91
  employee => {
92
    class       => 'SL::DB::Employee',
93
    key_columns => { employee_id => 'id' },
94
  },
95

  
76 96
  globalproject => {
77 97
    class       => 'SL::DB::Project',
78 98
    key_columns => { globalproject_id => 'id' },
79 99
  },
80 100

  
101
  language => {
102
    class       => 'SL::DB::Language',
103
    key_columns => { language_id => 'id' },
104
  },
105

  
106
  payment_terms => {
107
    class       => 'SL::DB::PaymentTerm',
108
    key_columns => { payment_id => 'id' },
109
  },
110

  
111
  salesman => {
112
    class       => 'SL::DB::Employee',
113
    key_columns => { salesman_id => 'id' },
114
  },
115

  
116
  shipto => {
117
    class       => 'SL::DB::Shipto',
118
    key_columns => { shipto_id => 'shipto_id' },
119
  },
120

  
81 121
  storno_obj => {
82 122
    class       => 'SL::DB::Invoice',
83 123
    key_columns => { storno_id => 'id' },
SL/DB/MetaSetup/InvoiceItem.pm
45 45
__PACKAGE__->meta->allow_inline_column_values(1);
46 46

  
47 47
__PACKAGE__->meta->foreign_keys(
48
  parts => {
48
  part => {
49 49
    class       => 'SL::DB::Part',
50 50
    key_columns => { parts_id => 'id' },
51 51
  },
52 52

  
53
  price_factor_obj => {
54
    class       => 'SL::DB::PriceFactor',
55
    key_columns => { price_factor_id => 'id' },
56
  },
57

  
58
  pricegroup => {
59
    class       => 'SL::DB::Pricegroup',
60
    key_columns => { pricegroup_id => 'id' },
61
  },
62

  
53 63
  project => {
54 64
    class       => 'SL::DB::Project',
55 65
    key_columns => { project_id => 'id' },
SL/DB/MetaSetup/Language.pm
24 24

  
25 25
__PACKAGE__->meta->allow_inline_column_values(1);
26 26

  
27
__PACKAGE__->meta->relationships(
28
  ap => {
29
    class      => 'SL::DB::PurchaseInvoice',
30
    column_map => { id => 'language_id' },
31
    type       => 'one to many',
32
  },
33

  
34
  ar => {
35
    class      => 'SL::DB::Invoice',
36
    column_map => { id => 'language_id' },
37
    type       => 'one to many',
38
  },
39

  
40
  customer => {
41
    class      => 'SL::DB::Customer',
42
    column_map => { id => 'language_id' },
43
    type       => 'one to many',
44
  },
45

  
46
  generic_translations => {
47
    class      => 'SL::DB::GenericTranslation',
48
    column_map => { id => 'language_id' },
49
    type       => 'one to many',
50
  },
51
);
52

  
53 27
# __PACKAGE__->meta->initialize;
54 28

  
55 29
1;
SL/DB/MetaSetup/Note.pm
30 30
  },
31 31
);
32 32

  
33
__PACKAGE__->meta->relationships(
34
  follow_ups => {
35
    class      => 'SL::DB::FollowUp',
36
    column_map => { id => 'note_id' },
37
    type       => 'one to many',
38
  },
39
);
40

  
41 33
# __PACKAGE__->meta->initialize;
42 34

  
43 35
1;
SL/DB/MetaSetup/Order.pm
97 97
    key_columns => { language_id => 'id' },
98 98
  },
99 99

  
100
  payment => {
101
    class       => 'SL::DB::PaymentTerm',
102
    key_columns => { payment_id => 'id' },
103
  },
104

  
100 105
  salesman => {
101 106
    class       => 'SL::DB::Employee',
102 107
    key_columns => { salesman_id => 'id' },
103 108
  },
104 109

  
110
  shipto => {
111
    class       => 'SL::DB::Shipto',
112
    key_columns => { shipto_id => 'shipto_id' },
113
  },
114

  
105 115
  vendor => {
106 116
    class       => 'SL::DB::Vendor',
107 117
    key_columns => { vendor_id => 'id' },
SL/DB/MetaSetup/OrderItem.pm
43 43
__PACKAGE__->meta->allow_inline_column_values(1);
44 44

  
45 45
__PACKAGE__->meta->foreign_keys(
46
  part => {
46
  parts => {
47 47
    class       => 'SL::DB::Part',
48 48
    key_columns => { parts_id => 'id' },
49 49
  },
......
63 63
    key_columns => { project_id => 'id' },
64 64
  },
65 65

  
66
  order => {
66
  trans => {
67 67
    class       => 'SL::DB::Order',
68 68
    key_columns => { trans_id => 'id' },
69 69
  },
SL/DB/MetaSetup/Part.pm
67 67
    key_columns => { buchungsgruppen_id => 'id' },
68 68
  },
69 69

  
70
  partsgroup => {
71
    class       => 'SL::DB::PartsGroup',
72
    key_columns => { partsgroup_id => 'id' },
73
  },
74

  
75
  payment => {
76
    class       => 'SL::DB::PaymentTerm',
77
    key_columns => { payment_id => 'id' },
78
  },
79

  
80
  price_factor => {
81
    class       => 'SL::DB::PriceFactor',
82
    key_columns => { price_factor_id => 'id' },
83
  },
84

  
70 85
  unit_obj => {
71 86
    class       => 'SL::DB::Unit',
72 87
    key_columns => { unit => 'name' },
SL/DB/MetaSetup/PartsGroup.pm
19 19

  
20 20
__PACKAGE__->meta->allow_inline_column_values(1);
21 21

  
22
__PACKAGE__->meta->relationships(
23
  parts => {
24
    class      => 'SL::DB::Part',
25
    column_map => { id => 'partsgroup_id' },
26
    type       => 'one to many',
27
  },
28
);
29

  
30 22
# __PACKAGE__->meta->initialize;
31 23

  
32 24
1;
SL/DB/MetaSetup/PaymentTerm.pm
25 25

  
26 26
__PACKAGE__->meta->allow_inline_column_values(1);
27 27

  
28
__PACKAGE__->meta->relationships(
29
  ap => {
30
    class      => 'SL::DB::PurchaseInvoice',
31
    column_map => { id => 'payment_id' },
32
    type       => 'one to many',
33
  },
34

  
35
  ar => {
36
    class      => 'SL::DB::Invoice',
37
    column_map => { id => 'payment_id' },
38
    type       => 'one to many',
39
  },
40

  
41
  customer => {
42
    class      => 'SL::DB::Customer',
43
    column_map => { id => 'payment_id' },
44
    type       => 'one to many',
45
  },
46

  
47
  oe => {
48
    class      => 'SL::DB::Order',
49
    column_map => { id => 'payment_id' },
50
    type       => 'one to many',
51
  },
52

  
53
  parts => {
54
    class      => 'SL::DB::Part',
55
    column_map => { id => 'payment_id' },
56
    type       => 'one to many',
57
  },
58
);
59

  
60 28
# __PACKAGE__->meta->initialize;
61 29

  
62 30
1;
SL/DB/MetaSetup/PeriodicInvoice.pm
25 25
    class       => 'SL::DB::Invoice',
26 26
    key_columns => { ar_id => 'id' },
27 27
  },
28

  
29
  config => {
30
    class       => 'SL::DB::PeriodicInvoicesConfig',
31
    key_columns => { config_id => 'id' },
32
  },
28 33
);
29 34

  
30 35
# __PACKAGE__->meta->initialize;
SL/DB/MetaSetup/PeriodicInvoicesConfig.pm
35 35
    class       => 'SL::DB::Order',
36 36
    key_columns => { oe_id => 'id' },
37 37
  },
38
);
39 38

  
40
__PACKAGE__->meta->relationships(
41
  ars => {
42
    map_class => 'SL::DB::PeriodicInvoice',
43
    map_from  => 'config',
44
    map_to    => 'ar',
45
    type      => 'many to many',
39
  printer => {
40
    class       => 'SL::DB::Printer',
41
    key_columns => { printer_id => 'id' },
46 42
  },
47 43
);
48 44

  
SL/DB/MetaSetup/PriceFactor.pm
17 17

  
18 18
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
19 19

  
20
__PACKAGE__->meta->relationships(
21
  invoice => {
22
    class      => 'SL::DB::InvoiceItem',
23
    column_map => { id => 'price_factor_id' },
24
    type       => 'one to many',
25
  },
26

  
27
  orderitems => {
28
    class      => 'SL::DB::OrderItem',
29
    column_map => { id => 'price_factor_id' },
30
    type       => 'one to many',
31
  },
32

  
33
  parts => {
34
    class      => 'SL::DB::Part',
35
    column_map => { id => 'price_factor_id' },
36
    type       => 'one to many',
37
  },
38
);
39

  
40 20
# __PACKAGE__->meta->initialize;
41 21

  
42 22
1;
SL/DB/MetaSetup/Pricegroup.pm
15 15

  
16 16
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
17 17

  
18
__PACKAGE__->meta->relationships(
19
  delivery_order_items => {
20
    class      => 'SL::DB::DeliveryOrderItem',
21
    column_map => { id => 'pricegroup_id' },
22
    type       => 'one to many',
23
  },
24

  
25
  invoice => {
26
    class      => 'SL::DB::InvoiceItem',
27
    column_map => { id => 'pricegroup_id' },
28
    type       => 'one to many',
29
  },
30

  
31
  orderitems => {
32
    class      => 'SL::DB::OrderItem',
33
    column_map => { id => 'pricegroup_id' },
34
    type       => 'one to many',
35
  },
36
);
37

  
38 18
# __PACKAGE__->meta->initialize;
39 19

  
40 20
1;
SL/DB/MetaSetup/Printer.pm
17 17

  
18 18
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
19 19

  
20
__PACKAGE__->meta->relationships(
21
  periodic_invoices_configs => {
22
    class      => 'SL::DB::PeriodicInvoicesConfig',
23
    column_map => { id => 'printer_id' },
24
    type       => 'one to many',
25
  },
26
);
27

  
28 20
# __PACKAGE__->meta->initialize;
29 21

  
30 22
1;
SL/DB/MetaSetup/PurchaseInvoice.pm
56 56
    key_columns => { cp_id => 'cp_id' },
57 57
  },
58 58

  
59
  currency => {
60
    class       => 'SL::DB::Currency',
61
    key_columns => { currency_id => 'id' },
62
  },
63

  
64
  department => {
65
    class       => 'SL::DB::Department',
66
    key_columns => { department_id => 'id' },
67
  },
68

  
69
  employee => {
70
    class       => 'SL::DB::Employee',
71
    key_columns => { employee_id => 'id' },
72
  },
73

  
59 74
  globalproject => {
60 75
    class       => 'SL::DB::Project',
61 76
    key_columns => { globalproject_id => 'id' },
62 77
  },
63 78

  
79
  language => {
80
    class       => 'SL::DB::Language',
81
    key_columns => { language_id => 'id' },
82
  },
83

  
84
  payment_terms => {
85
    class       => 'SL::DB::PaymentTerm',
86
    key_columns => { payment_id => 'id' },
87
  },
88

  
64 89
  storno_obj => {
65 90
    class       => 'SL::DB::PurchaseInvoice',
66 91
    key_columns => { storno_id => 'id' },
SL/DB/MetaSetup/Shipto.pm
32 32

  
33 33
__PACKAGE__->meta->allow_inline_column_values(1);
34 34

  
35
__PACKAGE__->meta->relationships(
36
  ar => {
37
    class      => 'SL::DB::Invoice',
38
    column_map => { shipto_id => 'shipto_id' },
39
    type       => 'one to many',
40
  },
41

  
42
  delivery_orders => {
43
    class      => 'SL::DB::DeliveryOrder',
44
    column_map => { shipto_id => 'shipto_id' },
45
    type       => 'one to many',
46
  },
47

  
48
  oe => {
49
    class      => 'SL::DB::Order',
50
    column_map => { shipto_id => 'shipto_id' },
51
    type       => 'one to many',
52
  },
53
);
54

  
55 35
# __PACKAGE__->meta->initialize;
56 36

  
57 37
1;
SL/DB/MetaSetup/TransferType.pm
21 21

  
22 22
__PACKAGE__->meta->allow_inline_column_values(1);
23 23

  
24
__PACKAGE__->meta->relationships(
25
  inventory => {
26
    class      => 'SL::DB::Inventory',
27
    column_map => { id => 'trans_type_id' },
28
    type       => 'one to many',
29
  },
30
);
31

  
32 24
# __PACKAGE__->meta->initialize;
33 25

  
34 26
1;

Auch abrufbar als: Unified diff