File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,10 @@ private function installDatabase()
181181 `price_total` decimal(20,6) NULL,
182182 `price_cod` decimal(20,6) NULL,
183183 `age_verification_required` tinyint(1) unsigned NULL,
184+ `point_place` varchar(70) NULL,
185+ `point_street` varchar(120) NULL AFTER `point_place`,
186+ `point_zip` varchar(10) NULL AFTER `point_street`,
187+ `point_city` varchar(70) NULL AFTER `point_zip`,
184188 UNIQUE(`id_order`),
185189 UNIQUE(`id_cart`)
186190 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ' ;
Original file line number Diff line number Diff line change 88
99use Packetery \Module \Helper ;
1010use Packetery \Tools \ConfigHelper ;
11+ use Packetery \Tools \DbTools ;
1112
1213if (!defined ('_PS_VERSION_ ' )) {
1314 exit ;
@@ -42,15 +43,22 @@ function upgrade_module_3_4_0(Packetery $module): bool
4243 if (!$ updateResult ) {
4344 return false ;
4445 }
45-
46- Db::getInstance ()->execute (
47- 'ALTER TABLE ` ' . _DB_PREFIX_ . 'packetery_order`
48- ADD `point_place` varchar(70) NULL,
49- ADD `point_street` varchar(120) NULL AFTER `point_place`,
50- ADD `point_zip` varchar(10) NULL AFTER `point_street`,
51- ADD `point_city` varchar(70) NULL AFTER `point_zip` '
52- );
5346 }
5447
55- return true ;
48+ $ sql = [
49+ 'ALTER TABLE ` ' . _DB_PREFIX_ . 'packetery_order`
50+ ADD `point_place` varchar(70) NULL,
51+ ADD `point_street` varchar(120) NULL AFTER `point_place`,
52+ ADD `point_zip` varchar(10) NULL AFTER `point_street`,
53+ ADD `point_city` varchar(70) NULL AFTER `point_zip` '
54+ ];
55+
56+ $ dbTools = $ module ->diContainer ->get (DbTools::class);
57+ $ executeResult = $ dbTools ->executeQueries (
58+ $ sql ,
59+ $ module ->l ('Exception raised during Packetery module upgrade: ' , 'upgrade-3.4.0 ' ),
60+ true
61+ );
62+
63+ return $ executeResult !== false ;
5664}
You can’t perform that action at this time.
0 commit comments