You’ll encounter an SQL error once you downgrade to an older version. This also happens if the database does not contain any version information. Installing the latest version will cause the SQL error because the installer tries to create database structures which are already there. You can fix this by changing the schema version in the database manually.
Use this query to find out the current version:
select * from #__schemas where extension_id in ( select extension_id from #__extensions where element = 'com_eventgallery' );
It should match the latest version you had installed.
Use this query to update the schema version:
update #__schemas set version_id='5.0.0_2023-05-18' where extension_id in ( select extension_id from #__extensions where element = 'com_eventgallery' );
Once you did this you can install the latest version again.
Don’t forget to replace
Joomla performs database updates by comparing the file names of some SQL files against each other.
The name of the latest version is stored in the database.
You can find those SQL files in [path]_administrator/components/com_eventgallery/sql/updates/mysql
Instead of using the value for the column
version_id in the SQL statement above you can try to use the file names in this folder as version numbers.
You’ll see file names like "3.3.0, 3.4.0, 3.4.0_2015-04-14". Try to repeat the following steps until the installation finished successfully.
Start with the oldest version number.
That’s usually the version you had installed before.
\#_schematable to a specific version like
3.4.0_2015-04-14. Always start with the oldest version! use the SQL statement above to do that.
- Install the whole package using the Joomla! Extension Manager.
- If you see an SQL error continue with step 1.
In case the query above does not work because it does not return any result, you need to insert a new row into the database.
You can use this code:
insert into #_schemas (extension_id, version_id) select extension_id, '1.0.0' from #_extensions where element = 'com_eventgallery'
Starting with Event Gallery 3.7.8 you can fix missing version information using the System Check page. If the version information is missing in the database, you just need to click the fix link on that page to add it. You can now install the update.