From 5227187243749e019d2b243d33caf4ffa5baa0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cankush=5Fm=E2=80=9D?= Date: Fri, 4 Oct 2019 17:05:24 +0530 Subject: [PATCH] Task #199 feat: Save process optimisation --- script.tjfields.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/script.tjfields.php b/script.tjfields.php index 141ad392..faf551b5 100755 --- a/script.tjfields.php +++ b/script.tjfields.php @@ -44,6 +44,11 @@ class Com_TjfieldsInstallerScript */ public function preflight($type, $parent) { + // Delete sql file if exist as related column is added through script + if (JFile::exists(JPATH_SITE . '/administrator/components/com_tjfields/sql/updates/mysql/1.3.1.sql')) + { + JFile::delete($image); + } } /** @@ -371,12 +376,6 @@ public function fix_db_on_update() } } - // Delete sql file if exist as related column is added through script - if (JFile::exists(JPATH_SITE . '/administrator/components/com_tjfields/sql/updates/mysql/1.3.1.sql')) - { - JFile::delete($image); - } - if (!in_array('showonlist', $field_array)) { $query = "ALTER TABLE `#__tjfields_fields` ADD COLUMN `showonlist` tinyint(1) NOT NULL";