2

I'm building a custom component, and on initial install on Joomla 3.3.6 it installs properly. However, when I install again, rather than running the update sql only from the current version+, it apparently is executing ALL the update sql files from the very beginning.

In the jos_extensions table, my component's manifest_cache show the version at "version":"3.3.2"-- this should mean that only sql update files 3.3.2+ should execute on upgrade. However, every update is being executed.

Can anyone think of a reason why this is happening? Thanks for any ideas.

1

As I don't have any reputation ;) a comment:

  • You have to check the xyz_schemas table for latest sql update version. With extension id no.
  • Do you use method="upgrade" in the xml manifest?
  • A more common problem is that the sql updates are not run if an initial (empty) sql update version was missing at the installation.
  • @schnuti-- thanks for the ideas. Can you clarify the last point? What do you mean by an empty sql update version? – user101289 Nov 11 '14 at 16:24
1

Joomla's keeps track of schema versions for itself and components in the #__schemas table. It lists the extension_id and with the version_id and uses that to determine what updates to run. For example you will see entries similar to this:

700    3.3.6-2014-09-30
709    1.2.0

As you might guess from the lines above 700 is the id of an extension called files_joomla i.e. Joomla.

You can read more about it in the Joomla Doc's article "Managing Component Updates (Update SQL files)" (which states 2.5 but I don't think it's changed since then).

Most people miss this note in the article:

Important Note: These files are also used to set the version number in the #__schemas table. This version number must be present in the current version of the component in order for the new SQL files to be run during the update. For example, if you have version 1.0 and are updating to version 1.1, the 1.1.sql file will not be executed if there was no 1.0.sql file in the 1.0 release. For this reason, it is good practice to have a SQL update file for each version, even if there is no SQL change in that version. You can just use an empty file or a file with a comment line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.