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";