From 3af4bf01871960ed2d28cda879701bda08d88990 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Thu, 24 Aug 2017 17:55:35 +0400 Subject: [PATCH] Ignore pre-existing rows sales_stock and receivings_stock already exist at the point this insert gets run causing the sql to fail. Adding the IGNORE directive causes duplicate entries to be skipped in the insert. --- database/2.3.1_to_2.3.2.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/2.3.1_to_2.3.2.sql b/database/2.3.1_to_2.3.2.sql index e044f2cdb..3f7c32bb6 100644 --- a/database/2.3.1_to_2.3.2.sql +++ b/database/2.3.1_to_2.3.2.sql @@ -22,10 +22,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('lines_per_page', '25'), ('show_total_discount', '25'); -INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) +INSERT IGNORE INTO `ospos_permissions` (permission_id, module_id, location_id) (SELECT CONCAT('sales_', location_name), 'sales', location_id FROM ospos_stock_locations); -INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) +INSERT IGNORE INTO `ospos_permissions` (permission_id, module_id, location_id) (SELECT CONCAT('receivings_', location_name), 'receivings', location_id FROM ospos_stock_locations); -- add item_pic column to items table