mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-25 00:44:03 -04:00
Fix sql upgrade scripts and UPGRADE.txt description (#1488)
This commit is contained in:
@@ -11,4 +11,6 @@ How to Upgrade
|
||||
Please try not to use the old layout, use the new one and just copy the content of the config variables
|
||||
8. Restore the content of the old uploads/ folder into public/uploads/ one
|
||||
9. Once new code is in place, database is updated and config files are sorted you are good to start the new OSPOS
|
||||
10. If any issue please check FAQ and/or GitHub issues as somebody else might have had your problem already or post a question
|
||||
10. Once logged in in OSPOS go to Migrate (see Migrate button after Store Config) and run the Migrate script
|
||||
11. Now you can use OSPOS
|
||||
12. If any issue please check FAQ and/or GitHub issues as somebody else might have had your problem already or post a question
|
||||
|
||||
@@ -9,10 +9,10 @@ ALTER TABLE `ospos_item_kit_items`
|
||||
|
||||
ALTER TABLE `ospos_item_quantities`
|
||||
MODIFY COLUMN `quantity` decimal(15,3) NOT NULL DEFAULT '0';
|
||||
|
||||
|
||||
ALTER TABLE `ospos_inventory`
|
||||
MODIFY COLUMN `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0';
|
||||
|
||||
|
||||
ALTER TABLE `ospos_receivings`
|
||||
DROP KEY `invoice_number`,
|
||||
CHANGE COLUMN `invoice_number` `reference` varchar(32) DEFAULT NULL,
|
||||
@@ -27,20 +27,20 @@ ALTER TABLE `ospos_sales_items`
|
||||
|
||||
ALTER TABLE `ospos_sales_suspended_items`
|
||||
MODIFY COLUMN `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0';
|
||||
|
||||
|
||||
ALTER TABLE `ospos_sales_items_taxes`
|
||||
MODIFY COLUMN `percent` decimal(15,3) NOT NULL;
|
||||
|
||||
|
||||
ALTER TABLE `ospos_sales_suspended_items_taxes`
|
||||
MODIFY COLUMN `percent` decimal(15,3) NOT NULL;
|
||||
|
||||
|
||||
ALTER TABLE `ospos_items_taxes`
|
||||
MODIFY COLUMN `percent` decimal(15,3) NOT NULL;
|
||||
|
||||
ALTER TABLE `ospos_customers`
|
||||
ADD COLUMN `discount_percent` decimal(15,2) NOT NULL DEFAULT '0';
|
||||
|
||||
|
||||
|
||||
-- alter config table
|
||||
|
||||
ALTER TABLE `ospos_app_config`
|
||||
@@ -51,11 +51,16 @@ UPDATE `ospos_app_config` SET `key` = 'receipt_show_total_discount' WHERE `key`
|
||||
|
||||
DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template';
|
||||
DELETE FROM `ospos_app_config` WHERE `key` = 'language';
|
||||
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('receipt_show_description', '1'),
|
||||
('receipt_show_serialnumber', '1'),
|
||||
('invoice_enable', '1'),
|
||||
('number_locale', 'en_US'),
|
||||
('thousands_separator', '1'),
|
||||
('currency_decimals', '2'),
|
||||
('tax_decimals', '2'),
|
||||
('quantity_decimals', '0'),
|
||||
('country_codes', 'us'),
|
||||
('notify_horizontal_position', 'right'),
|
||||
('notify_vertical_position', 'top'),
|
||||
@@ -65,11 +70,18 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl'),
|
||||
('smtp_host', ''),
|
||||
('smtp_pass', ''),
|
||||
('smtp_user', ''),
|
||||
('receipt_template', 'receipt_default'),
|
||||
('theme', 'flatly'),
|
||||
('statistics', '1'),
|
||||
('language', 'english'),
|
||||
('language_code', 'en');
|
||||
('language_code', 'en'),
|
||||
('msg_msg', ''),
|
||||
('msg_uid', ''),
|
||||
('msg_src', ''),
|
||||
('msg_pwd', '');
|
||||
|
||||
|
||||
-- add messages (SMS) module and permissions
|
||||
@@ -78,10 +90,10 @@ UPDATE `ospos_modules` SET `sort` = 110 WHERE `name_lang_key` = 'module_config';
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_messages', 'module_messages_desc', 100, 'messages');
|
||||
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('messages', 'messages');
|
||||
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('messages', 1);
|
||||
|
||||
@@ -104,4 +116,4 @@ CREATE TABLE `ospos_sessions` (
|
||||
ALTER TABLE `ospos_employees`
|
||||
ADD COLUMN `hash_version` int(1) NOT NULL DEFAULT '2';
|
||||
|
||||
UPDATE `ospos_employees` SET `hash_version` = 1;
|
||||
UPDATE `ospos_employees` SET `hash_version` = 1;
|
||||
|
||||
@@ -39,8 +39,8 @@ CREATE TABLE IF NOT EXISTS `ospos_dinner_tables` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `ospos_dinner_tables` (`dinner_table_id`, `name`, `status`, `deleted`) VALUES
|
||||
(1, 'Delivery', 0, 0),
|
||||
(2, 'Take Away', 0, 0);
|
||||
(1, 'Delivery', 0, 0),
|
||||
(2, 'Take Away', 0, 0);
|
||||
|
||||
-- alter ospos_sales table
|
||||
|
||||
@@ -63,13 +63,13 @@ ALTER TABLE `ospos_sales_suspended`
|
||||
-- add enabled dinner tables key into config
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('date_or_time_format', ''),
|
||||
('sales_quote_format', 'Q%y{QSEQ:6}'),
|
||||
('default_register_mode', 'sale'),
|
||||
('last_used_invoice_number', '0'),
|
||||
('last_used_quote_number', '0'),
|
||||
('line_sequence', '0'),
|
||||
('dinner_table_enable', '');
|
||||
('date_or_time_format', ''),
|
||||
('sales_quote_format', 'Q%y{QSEQ:6}'),
|
||||
('default_register_mode', 'sale'),
|
||||
('last_used_invoice_number', '0'),
|
||||
('last_used_quote_number', '0'),
|
||||
('line_sequence', '0'),
|
||||
('dinner_table_enable', '0');
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_customer_packages`
|
||||
@@ -84,11 +84,11 @@ CREATE TABLE IF NOT EXISTS `ospos_customers_packages` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
INSERT INTO `ospos_customers_packages` (`package_id`, `package_name`, `points_percent`, `deleted`) VALUES
|
||||
(1, 'Default', 0, 0),
|
||||
(2, 'Bronze', 10, 0),
|
||||
(3, 'Silver', 20, 0),
|
||||
(4, 'Gold', 30, 0),
|
||||
(5, 'Premium', 50, 0);
|
||||
(1, 'Default', 0, 0),
|
||||
(2, 'Bronze', 10, 0),
|
||||
(3, 'Silver', 20, 0),
|
||||
(4, 'Gold', 30, 0),
|
||||
(5, 'Premium', 50, 0);
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_customer_points`
|
||||
@@ -124,7 +124,7 @@ ALTER TABLE ospos_customers
|
||||
-- add enabled reward points key into config
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('customer_reward_enable','');
|
||||
('customer_reward_enable', '0');
|
||||
|
||||
--
|
||||
-- The following changes are in support of customer sales tax changes
|
||||
@@ -188,19 +188,26 @@ ALTER TABLE `ospos_customers`
|
||||
ADD COLUMN `sales_tax_code` varchar(32) NOT NULL DEFAULT '1';
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('customer_sales_tax_support', '0'),
|
||||
('default_origin_tax_code', '');
|
||||
('customer_sales_tax_support', '0'),
|
||||
('default_origin_tax_code', ''),
|
||||
('default_tax_category', 'Standard'),
|
||||
('default_tax_1_name', ''),
|
||||
('default_tax_1_rate', ''),
|
||||
('default_tax_2_name', ''),
|
||||
('default_tax_2_rate', '');
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes');
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('taxes', 'taxes');
|
||||
('taxes', 'taxes');
|
||||
|
||||
-- add support for cash rounding into config
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('cash_decimals', '2');
|
||||
('currency_decimals', '2'),
|
||||
('cash_decimals', '2'),
|
||||
('cash_rounding_code', '0');
|
||||
|
||||
-- alter people table (create email index)
|
||||
|
||||
@@ -210,7 +217,7 @@ ALTER TABLE `ospos_people`
|
||||
-- add financial year start into config
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('financial_year', '1');
|
||||
('financial_year', '1');
|
||||
|
||||
-- alter giftcard field number to be varchar
|
||||
|
||||
@@ -227,13 +234,13 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_company_na
|
||||
-- add support for sales tax history migration
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_migrate', 'module_migrate_desc', 120, 'migrate');
|
||||
('module_migrate', 'module_migrate_desc', 120, 'migrate');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('migrate', 'migrate');
|
||||
('migrate', 'migrate');
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('migrate', 1);
|
||||
('migrate', 1);
|
||||
|
||||
-- update to receivings
|
||||
|
||||
@@ -252,9 +259,9 @@ ALTER TABLE `ospos_tax_categories`
|
||||
MODIFY COLUMN `tax_category_id` int(10) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
INSERT INTO `ospos_tax_categories` ( `tax_category_id`, `tax_category`, `tax_group_sequence` ) VALUES
|
||||
(1, 'Standard', 10),
|
||||
(2, 'Service', 12),
|
||||
(3, 'Alcohol', 11);
|
||||
(1, 'Standard', 10),
|
||||
(2, 'Service', 12),
|
||||
(3, 'Alcohol', 11);
|
||||
|
||||
ALTER TABLE `ospos_items`
|
||||
MODIFY COLUMN `tax_category_id` int(10) NOT NULL DEFAULT 1;
|
||||
@@ -272,7 +279,7 @@ UPDATE `ospos_tax_code_rates` SET rate_tax_category_id = 1 WHERE rate_tax_catego
|
||||
-- add receipt font size
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('receipt_font_size', '12');
|
||||
('receipt_font_size', '12');
|
||||
|
||||
--
|
||||
-- Add rewards foreign keys
|
||||
@@ -297,14 +304,14 @@ ALTER TABLE `ospos_customers`
|
||||
-- add reCAPTCHA configuration
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('gcaptcha_enable', '0'),
|
||||
('gcaptcha_secret_key', ''),
|
||||
('gcaptcha_site_key', '');
|
||||
('gcaptcha_enable', '0'),
|
||||
('gcaptcha_secret_key', ''),
|
||||
('gcaptcha_site_key', '');
|
||||
|
||||
-- add Barcode formats
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('barcode_formats', '[]');
|
||||
('barcode_formats', '[]');
|
||||
|
||||
-- replace old tokens in ospos_app_config
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_decimals', '2'),
|
||||
('quantity_decimals', '0'),
|
||||
('country_codes', 'us'),
|
||||
('default_tax_1_name', ''),
|
||||
('default_tax_1_rate', ''),
|
||||
('default_tax_2_name', ''),
|
||||
('default_tax_2_rate', ''),
|
||||
('msg_msg', ''),
|
||||
('msg_uid', ''),
|
||||
('msg_src', ''),
|
||||
@@ -86,16 +90,21 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl'),
|
||||
('smtp_host', ''),
|
||||
('smtp_pass', ''),
|
||||
('smtp_user', ''),
|
||||
('receipt_template', 'receipt_default'),
|
||||
('theme', 'flatly'),
|
||||
('customer_sales_tax_support', '0'),
|
||||
('statistics', '1'),
|
||||
('language', 'english'),
|
||||
('language_code', 'en'),
|
||||
('date_or_time_format',''),
|
||||
('customer_reward_enable',''),
|
||||
('date_or_time_format', ''),
|
||||
('dinner_table_enable', '0'),
|
||||
('customer_reward_enable', '0'),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('cash_rounding_code', '0'),
|
||||
('financial_year', '1'),
|
||||
('giftcard_number', 'series'),
|
||||
('receipt_font_size', '12'),
|
||||
|
||||
@@ -74,6 +74,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_decimals', '2'),
|
||||
('quantity_decimals', '0'),
|
||||
('country_codes', 'us'),
|
||||
('default_tax_1_name', ''),
|
||||
('default_tax_1_rate', ''),
|
||||
('default_tax_2_name', ''),
|
||||
('default_tax_2_rate', ''),
|
||||
('msg_msg', ''),
|
||||
('msg_uid', ''),
|
||||
('msg_src', ''),
|
||||
@@ -86,16 +90,21 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl'),
|
||||
('smtp_host', ''),
|
||||
('smtp_pass', ''),
|
||||
('smtp_user', ''),
|
||||
('receipt_template', 'receipt_default'),
|
||||
('theme', 'flatly'),
|
||||
('customer_sales_tax_support', '0'),
|
||||
('statistics', '1'),
|
||||
('language', 'english'),
|
||||
('language_code', 'en'),
|
||||
('date_or_time_format',''),
|
||||
('customer_reward_enable',''),
|
||||
('date_or_time_format', ''),
|
||||
('dinner_table_enable', '0'),
|
||||
('customer_reward_enable', '0'),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('cash_rounding_code', '0'),
|
||||
('financial_year', '1'),
|
||||
('giftcard_number', 'series'),
|
||||
('receipt_font_size', '12'),
|
||||
|
||||
@@ -74,6 +74,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_decimals', '2'),
|
||||
('quantity_decimals', '0'),
|
||||
('country_codes', 'us'),
|
||||
('default_tax_1_name', ''),
|
||||
('default_tax_1_rate', ''),
|
||||
('default_tax_2_name', ''),
|
||||
('default_tax_2_rate', ''),
|
||||
('msg_msg', ''),
|
||||
('msg_uid', ''),
|
||||
('msg_src', ''),
|
||||
@@ -86,16 +90,21 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('smtp_port', '465'),
|
||||
('smtp_timeout', '5'),
|
||||
('smtp_crypto', 'ssl'),
|
||||
('smtp_host', ''),
|
||||
('smtp_pass', ''),
|
||||
('smtp_user', ''),
|
||||
('receipt_template', 'receipt_default'),
|
||||
('theme', 'flatly'),
|
||||
('customer_sales_tax_support', '0'),
|
||||
('statistics', '1'),
|
||||
('language', 'english'),
|
||||
('language_code', 'en'),
|
||||
('date_or_time_format',''),
|
||||
('customer_reward_enable',''),
|
||||
('date_or_time_format', ''),
|
||||
('dinner_table_enable', '0'),
|
||||
('customer_reward_enable', '0'),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('cash_rounding_code', '0'),
|
||||
('financial_year', '1'),
|
||||
('giftcard_number', 'series'),
|
||||
('receipt_font_size', '12'),
|
||||
|
||||
Reference in New Issue
Block a user