mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-03 13:23:00 -04:00
add distinct designation to prevent sql error
without distinct it migrates multiple copies of the same stock location name which later cause issues in 2.3_to_2.3.1.sql when trying to insert into ospos_permissions.
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
INSERT INTO ospos_stock_locations (location_name) (SELECT location FROM ospos_items WHERE NOT EXISTS (select location from ospos_stock_locations where location_name = location));
|
||||
INSERT INTO ospos_stock_locations (location_name) (SELECT DISTINCT(location) FROM ospos_items WHERE NOT EXISTS (select location from ospos_stock_locations where location_name = location));
|
||||
INSERT INTO ospos_item_quantities (item_id, location_id, quantity) (SELECT item_id, location_id, quantity FROM ospos_items, ospos_stock_locations where ospos_items.location = ospos_stock_locations.location_name);
|
||||
|
||||
Reference in New Issue
Block a user