mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-06-03 05:06:30 -04:00
Added a data migration script for stock_locations and item_quantities tables git-svn-id: svn+ssh://svn.code.sf.net/p/opensourcepos/code/@127 c3eb156b-1dc0-44e1-88ae-e38439141b53
3 lines
392 B
SQL
3 lines
392 B
SQL
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_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);
|