Files
opensourcepos/app/Database/Migrations/sqlscripts/pre-3.0.2/2.3_migrate_locations.sql
objecttothis 86395a69d9 Moved pre-automated migrations scripts
These scripts are prior to 3.0.2 when automated migrations did not exist.
2023-04-27 21:54:10 -04:00

4 lines
448 B
SQL

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);
ALTER TABLE ospos_items DROP COLUMN location;