Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6cde4d1d

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 6cde4d1d7e444d3471f7329153c2d18f8daac85f
  • Vorgänger 46f7dbff
  • Nachfolger cd9e51e6

Fremschlüssel für »unit« in Tabellen orderitems, delivery_order_items, invoice

Unterschiede anzeigen:

SL/DB/DeliveryOrderItem.pm
15 15
);
16 16

  
17 17
__PACKAGE__->meta->make_manager_class;
18
__PACKAGE__->meta->add_relationship(
19
  unit_obj       => {
20
    type         => 'many to one',
21
    class        => 'SL::DB::Unit',
22
    column_map   => { unit => 'name' },
23
  },
24
);
25 18

  
26 19
__PACKAGE__->meta->initialize;
27 20

  
SL/DB/InvoiceItem.pm
14 14
  },
15 15
);
16 16

  
17
__PACKAGE__->meta->add_relationship(
18
  unit_obj       => {
19
    type         => 'many to one',
20
    class        => 'SL::DB::Unit',
21
    column_map   => { unit => 'name' },
22
  },
23
);
24

  
25 17
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
26 18
__PACKAGE__->meta->make_manager_class;
27 19

  
SL/DB/MetaSetup/DeliveryOrderItem.pm
63 63
    class       => 'SL::DB::Project',
64 64
    key_columns => { project_id => 'id' },
65 65
  },
66

  
67
  unit_obj => {
68
    class       => 'SL::DB::Unit',
69
    key_columns => { unit => 'name' },
70
  },
66 71
);
67 72

  
68 73
1;
SL/DB/MetaSetup/InvoiceItem.pm
64 64
    class       => 'SL::DB::Project',
65 65
    key_columns => { project_id => 'id' },
66 66
  },
67

  
68
  unit_obj => {
69
    class       => 'SL::DB::Unit',
70
    key_columns => { unit => 'name' },
71
  },
67 72
);
68 73

  
69 74
1;
SL/DB/MetaSetup/OrderItem.pm
67 67
    class       => 'SL::DB::Project',
68 68
    key_columns => { project_id => 'id' },
69 69
  },
70

  
71
  unit_obj => {
72
    class       => 'SL::DB::Unit',
73
    key_columns => { unit => 'name' },
74
  },
70 75
);
71 76

  
72 77
1;
SL/DB/OrderItem.pm
17 17
  },
18 18
);
19 19

  
20
__PACKAGE__->meta->add_relationship(
21
  unit_obj       => {
22
    type         => 'many to one',
23
    class        => 'SL::DB::Unit',
24
    column_map   => { unit => 'name' },
25
  },
26
);
27

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

  
30 22
sub is_price_update_available {
sql/Pg-upgrade2/unit_foreign_key_for_line_items.sql
1
-- @tag: unit_foreign_key_for_line_items
2
-- @description: Fremdschlüssel auf »unit« für Beleg-Positionstabellen
3
-- @depends: release_3_0_0
4
ALTER TABLE orderitems           ADD FOREIGN KEY (unit) REFERENCES units (name);
5
ALTER TABLE delivery_order_items ADD FOREIGN KEY (unit) REFERENCES units (name);
6
ALTER TABLE invoice              ADD FOREIGN KEY (unit) REFERENCES units (name);

Auch abrufbar als: Unified diff