Closed Heklaterriol closed 2 days ago
Or is there a way to check during installation, if the tables are set up correctly and if not apply these commands?
During the installation scrips, check if JEM exist as JEM extension, if it's start the update process with upgrade tables. The issue is when JEM isn't installed and the tables exist, because the installation script start the installation process and when it wants to create the table, they exist and the tables aren't updated. I think that I can change the installation script to run your script to update the tables. So, we have covered the case of users with JEM uninstaller. Can we try this solution? I go on it
I have tried to modify the pkg_jem\packages\com_jem.zip\com_jem\admin\sql\install.mysql.utf8.sql with:
SET @database_name = DATABASE();
SELECT COUNT(*) INTO @table_exists FROM information_schema.tables WHERE table_schema = @database_name AND table_name = `#__jem_events`;
IF @table_exists = 0 THEN
CREATE TABLE `#__jem_events` (
`id` int(11) unsigned NOT NULL auto_increment,
`locid` int(11) unsigned NOT NULL DEFAULT '0',
...
KEY `idx_language` (`language`)
) ENGINE=MyISAM CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
END IF;
IF @table_exists > 0 THEN
ALTER TABLE `#__jem_events` CHANGE `modified` `modified` datetime DEFAULT NULL;
ALTER TABLE `#__jem_events` CHANGE `created` `created` datetime NOT NULL DEFAULT current_timestamp();
...
ALTER TABLE `#__jem_events` ADD `reservedplaces` INT NOT NULL DEFAULT '1' AFTER `maxbookeduser`;
END IF;
...
But the install process in Joomla, read one by one line to execute query and it give errors. Doesn't work. I'll try to do other invent.
How about:
ALTER TABLE `YOUR_PREFIX_jem_register` ADD `status` tinyint(3) NOT NULL DEFAULT 1 AFTER `waiting`;
see https://www.joomlaeventmanager.net/forum/bugs/12404-solved-unknown-column-status-in-field-list
This issue was detected, the error was that there was to add COLUMN after ADD. It can be closed.
I checked out the errors which occur, if someone does the update process, but uninstalled JEM 2.3.6. I did a correct update (without uninstalling), one with uninstalling and then compared the DBs.
I then created a SQL command list, to fix the defective DB:
I hope I caught all.
Maybe it is of some use …