@@ -79,7 +79,7 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
7979 }
8080
8181 if (version_compare ($ context ->getVersion (), '1.2.0 ' , '< ' )) {
82- $ this ->upgradeTo120 ($ setup );
82+ $ this ->upgradeTo120 ($ setup, $ context );
8383 }
8484 }
8585
@@ -171,8 +171,6 @@ protected function upgradeTo110(SchemaSetupInterface $setup)
171171 Logger::logInfo ('Update script V1.1.0 has been successfully completed. ' );
172172 } catch (\Exception $ e ) {
173173 Logger::logError ("V1.1.0 update script failed because: {$ e ->getMessage ()}" );
174-
175- throw $ e ;
176174 }
177175 }
178176
@@ -200,17 +198,23 @@ protected function upgradeTo114(SchemaSetupInterface $setup)
200198 * Runs the upgrade script for v1.2.0.
201199 *
202200 * @param SchemaSetupInterface $setup
201+ * @param \Magento\Framework\Setup\ModuleContextInterface $context
203202 *
204- * @throws \Exception
203+ * @throws \Packlink\PacklinkPro\IntegrationCore\Infrastructure\ORM\Exceptions\RepositoryNotRegisteredException
204+ * @throws \Packlink\PacklinkPro\IntegrationCore\Infrastructure\TaskExecution\Exceptions\QueueStorageUnavailableException
205205 */
206- protected function upgradeTo120 (SchemaSetupInterface $ setup )
206+ protected function upgradeTo120 (SchemaSetupInterface $ setup, ModuleContextInterface $ context )
207207 {
208208 Logger::logInfo ('Started executing V1.2.0 update script. ' );
209209
210- $ this ->updateShippingMethods ($ setup );
211-
212210 $ this ->convertParcelProperties ($ setup );
213211
212+ if (version_compare ($ context ->getVersion (), '1.1.0 ' , '< ' )) {
213+ $ this ->updateShippingServices ();
214+ }
215+
216+ $ this ->updateShippingMethods ($ setup );
217+
214218 Logger::logInfo ('Update script V1.2.0 has been successfully completed. ' );
215219 }
216220
0 commit comments