diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 2652ed369..09761d89a 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -37,6 +37,9 @@ ALTER TABLE `ospos_items_taxes` ALTER TABLE `ospos_customers` ADD COLUMN `discount_percent` decimal(15,2) NOT NULL DEFAULT '0.00'; + +-- alter config table + UPDATE `ospos_app_config` SET `key` = 'receipt_show_total_discount' WHERE `key` = 'show_total_discount'; INSERT INTO `ospos_app_config` (`key`, `value`) VALUES @@ -56,6 +59,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template'; + +-- add messages (SMS) module and permissions + 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 @@ -67,6 +73,16 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('messages', 1); -ALTER TABLE `ospos_sessions` - DROP PRIMARY KEY; + +-- alter sessions table + +DROP TABLE `ospos_sessions`; + +CREATE TABLE `ospos_sessions` ( + `id` varchar(40) NOT NULL, + `ip_address` varchar(45) NOT NULL, + `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, + `data` blob NOT NULL, + KEY `ci_sessions_timestamp` (`timestamp`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/database/database.sql b/database/database.sql index 2012108f0..5b55f083f 100644 --- a/database/database.sql +++ b/database/database.sql @@ -676,10 +676,11 @@ CREATE TABLE `ospos_sales_suspended_payments` ( -- CREATE TABLE `ospos_sessions` ( - `id` varchar(40) NOT NULL DEFAULT '0', - `ip_address` varchar(45) NOT NULL DEFAULT '0', + `id` varchar(40) NOT NULL, + `ip_address` varchar(45) NOT NULL, + `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, - `timestamp` int(10) unsigned NOT NULL DEFAULT '0' + KEY `ci_sessions_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index ac3657827..a21821db4 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -676,10 +676,11 @@ CREATE TABLE `ospos_sales_suspended_payments` ( -- CREATE TABLE `ospos_sessions` ( - `id` varchar(40) NOT NULL DEFAULT '0', - `ip_address` varchar(45) NOT NULL DEFAULT '0', + `id` varchar(40) NOT NULL, + `ip_address` varchar(45) NOT NULL, + `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, - `timestamp` int(10) unsigned NOT NULL DEFAULT '0' + KEY `ci_sessions_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- diff --git a/database/tables.sql b/database/tables.sql index 0e02835c3..afdac72d5 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -676,10 +676,11 @@ CREATE TABLE `ospos_sales_suspended_payments` ( -- CREATE TABLE `ospos_sessions` ( - `id` varchar(40) NOT NULL DEFAULT '0', - `ip_address` varchar(45) NOT NULL DEFAULT '0', + `id` varchar(40) NOT NULL, + `ip_address` varchar(45) NOT NULL, + `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, - `timestamp` int(10) unsigned NOT NULL DEFAULT '0' + KEY `ci_sessions_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --