SQL error upgrading from Seafile Pro from 9.0.16 to 10.0.5

Centos v7 system with MariaDB v5.5.68. All minor v9.x upgrades have worked fine. Following error thrown when running upgrade_9.0_10.0.sh

> [INFO] You are using MySQL
> [INFO] updating ccnet database...
> [INFO] updating seafile database...
> [WARNING] Failed to execute sql: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS `repo_id` (`repo_id`)' at line 1")
> [INFO] updating seahub database...
> Done

I’ve followed the instructions here:

Outline - Seafile Admin Manual

Which is basically the same as a minor upgrade except you run the upgrade scripts increase of minor-upgrade.sh

Digging into the scripts, it appears to be failing at this SQL line:

ALTER TABLE `WebUploadTempFiles` ADD INDEX IF NOT EXISTS `repo_id` (`repo_id`);

Later… running the above command fails on MariaDB v5.5.68 although reading the manual, it should work. It appears to be the IF NOT EXISTS bit that’s the problem. This runs okay:

ALTER TABLE `WebUploadTempFiles` ADD INDEX `repo_id` (`repo_id`);

I do note that the version of MariaDB that I’m running on my server isn’t the latest version (v5.5.68) but it was the last version for the v5.5 series. Is it still supported by Seafile?

Carrying on my debugging of this. I upgraded MariaDB from v5.5.68 to 11.0.2 (the latest) and Seafile v9.0.16 stopped working. Client appeared to be okay but website won’t load. However, I pushed ahead with Seafile 10.0.5 upgrade and this time I didn’t get the error.

However, the system is totally broken: libraries are throwing errors and seahub won’t load. A shame but not totally unsurprising!

But my main reason for doing this was to check whether that SQL command above (add index) was supported on a later version of MariaDB after 5.5.68. Which it is.

So what I need now is a version of MariaDB after 5.5.68 which works with Seafile. That’s one for another day. I’ve restored the server back to an earlier snapshot as production time calls!