Update from 10.2.5 to 10.3 isn't compatible with MySQL / MariaDB
After updating from Gitlab 10.2.5 to 10.3.0 on my Archlinux server (using the community repository packages) I tried running the usual rake script to migrate data. First I ran into #41483 (closed). I worked around that with some manual tweaks to my INNODB storage type. Re-running the migration script got past that stage but died at another one:
== 20171106151218 IssuesMovedToIdForeignKey: migrating ========================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'issues' is specified twice, both as a target for 'UPDATE' and as a separate source for data: UPDATE `issues` SET `issues`.`moved_to_id` = NULL WHERE (NOT EXISTS (SELECT true FROM issues WHERE issues.id = issues.moved_to_id)) AND (moved_to_id IS NOT NULL) AND (`issues`.`id` >= 306)
Judging from this and this this seems like an SQL syntax issue that could be avoided by using something MariaDB can handle.
Server version: 10.1.29-MariaDB MariaDB Server
Edited by Caleb Maclennan