* @copyright 2007-2018 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ $sql = array(); $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ochat_message` ( `id_message` INT(5) NOT NULL AUTO_INCREMENT, `message_content` LONGTEXT NOT NULL, `message_date` DATETIME NOT NULL, `id_thread` INT(5) NOT NULL, `id_employee` INT NULL, `id_customer` INT NULL, `id_guest` INT NULL, PRIMARY KEY (`id_message`), KEY id_thread_index (id_thread), KEY id_employee_index (id_employee), KEY id_customer_index (id_customer), KEY id_guest_index (id_guest) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ochat_thread` ( `id_thread` INT(5) NOT NULL AUTO_INCREMENT, `id_shop` INT(11) NOT NULL, `create_date` DATETIME NOT NULL, `id_lang` INT NOT NULL, PRIMARY KEY (`id_thread`), KEY id_lang_index (id_lang) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ochat_log` ( `id_log` INT(2) NOT NULL AUTO_INCREMENT, `is_connected` INT(1) NOT NULL, `last_log_in` DATETIME NULL, `last_log_out` DATETIME NULL, `id_employee` INT(11) NOT NULL, PRIMARY KEY (`id_log`), KEY id_lemployee_index (id_employee) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; foreach ($sql as $query) { if (Db::getInstance()->execute($query) == false) { return false; } }