);
__PACKAGE__->meta->make_manager_class;
-__PACKAGE__->meta->add_relationship(
- unit_obj => {
- type => 'many to one',
- class => 'SL::DB::Unit',
- column_map => { unit => 'name' },
- },
-);
__PACKAGE__->meta->initialize;
},
);
-__PACKAGE__->meta->add_relationship(
- unit_obj => {
- type => 'many to one',
- class => 'SL::DB::Unit',
- column_map => { unit => 'name' },
- },
-);
-
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
__PACKAGE__->meta->make_manager_class;
class => 'SL::DB::Project',
key_columns => { project_id => 'id' },
},
+
+ unit_obj => {
+ class => 'SL::DB::Unit',
+ key_columns => { unit => 'name' },
+ },
);
1;
class => 'SL::DB::Project',
key_columns => { project_id => 'id' },
},
+
+ unit_obj => {
+ class => 'SL::DB::Unit',
+ key_columns => { unit => 'name' },
+ },
);
1;
class => 'SL::DB::Project',
key_columns => { project_id => 'id' },
},
+
+ unit_obj => {
+ class => 'SL::DB::Unit',
+ key_columns => { unit => 'name' },
+ },
);
1;
},
);
-__PACKAGE__->meta->add_relationship(
- unit_obj => {
- type => 'many to one',
- class => 'SL::DB::Unit',
- column_map => { unit => 'name' },
- },
-);
-
__PACKAGE__->meta->initialize;
sub is_price_update_available {
--- /dev/null
+-- @tag: unit_foreign_key_for_line_items
+-- @description: Fremdschlüssel auf »unit« für Beleg-Positionstabellen
+-- @depends: release_3_0_0
+ALTER TABLE orderitems ADD FOREIGN KEY (unit) REFERENCES units (name);
+ALTER TABLE delivery_order_items ADD FOREIGN KEY (unit) REFERENCES units (name);
+ALTER TABLE invoice ADD FOREIGN KEY (unit) REFERENCES units (name);