Skip to content

Database migration fails with Mysql v8 (not mariadb)

Hi, while attempting to update the Cloudron castopod package, we encountered an issue that the db migration fails for version 1.6.1:

root@1ce52b9a-e753-4bbd-a7b8-a00a6822e993:/app/code# /usr/bin/php /app/code/spark migrate -all

CodeIgniter v4.4.1 Command Line Tool - Server Time: 2023-09-11 10:31:57 UTC+00:00

Running all new migrations...

[CodeIgniter\Database\Exceptions\DatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS title' at line 1

at SYSTEMPATH/Database/BaseConnection.php:646

Cloudron runs mysql v8 and it appears that https://code.castopod.org/adaures/castopod/-/blob/develop/app/Database/Migrations/2023-06-12-010000_add_full_text_search_indexes.php#L14 is not supported there: https://stackoverflow.com/questions/2480148/how-can-i-employ-if-exists-for-creating-or-dropping-an-index-in-mysql

I will see if I can provide a patch for this, if there is a chance that it gets accepted.