update
This commit is contained in:
45
modules/anblog/upgrade/install-3.4.0.php
Normal file
45
modules/anblog/upgrade/install-3.4.0.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* 2024 Anvanto
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
*
|
||||
* @author Anvanto <anvantoco@gmail.com>
|
||||
* @copyright 2024 Anvanto
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
function upgrade_module_3_4_0($object)
|
||||
{
|
||||
|
||||
|
||||
$sql[] = '
|
||||
ALTER TABLE `'._DB_PREFIX_.'anblog_blog` ADD COLUMN `likes` int(11) NOT NULL;
|
||||
';
|
||||
|
||||
$sql[] = '
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'anblog_likes` (
|
||||
`id_like` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_customer_guest` int(11) NOT NULL,
|
||||
`id_post` int(11) NOT NULL,
|
||||
`id_shop` int(11) NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_like`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
';
|
||||
|
||||
$return = true;
|
||||
foreach ($sql as $_sql) {
|
||||
$return = Db::getInstance()->Execute($_sql);
|
||||
if (!$return){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user