Columns added to support MySQL group replication (every table must have a primary key)
Besides changing the schema, there also needs to be an update script, that performs the changes while updating.
Also I'm not sure if
INTEGER is the right choice. We are already having issues at other places where
INTEGER is simply too small.
Integer was changed to BIGINT. Where would we place the update script? Which file is best as an example?
As I don't think this will get merged for 3.0.5, maybe you could name the Update-Script 3.1.0 already.
Update script was created core/Updates/3.1.0.php. Hopefully we could be considered for 3.1.0.
Tested the update script and it works well. Retested and everything checks out and we are ready for merge.
Ok, tabs were changed to spaces.
When trying to run the upgrade it fails because there is already one field with auto increment in
site_setting table, see:
The database upgrade process may take a while, so please be patient. Executing ALTER TABLE `piwik_plugin_setting` ADD COLUMN `idplugin_setting` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT;... Done. [1 / 3] Executing ALTER TABLE `piwik_site_setting` ADD COLUMN `idsite_setting` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT;... [X] Critical Error during the update process: * core/Updates/3.2.1.php: Error trying to execute the migration 'ALTER TABLE `piwik_site_setting` ADD COLUMN `idsite_setting` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT;'.
Hi Matt, We do not receive that error. Looking at the file, there does not appear to be any other column in that table with AUTO_INCREMENT. Is it possible, that your tester ran the code twice and received the error on the second run (maybe after adding the primary key column by the original name)?