Migration errors when upgrading (gitlab-ee, mysql)

Hi,

When attempting to upgrade from ee-9.5.10 to ee-10.8.7 I got the following when running db migrations

#<ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect datetime value: '2017-04-
10T12:43:19.000-07:00' for column 'authored_date' at row 1:         INSERT INTO 
merge_request_diff_commits (`message`, `authored_date`

authored_date is a timestamp

UPDATE: going from 10.2.8 to 10.3.0 is where I first get a migration error (see reply below)

Retried on a droplet running MySQL 5.7 and was able to get to 10.3.0, but still had the same problem with 10.8.7.

As well as 10.3.9, that is

'2017-04-10T12:43:19.000-07:00' for column 'authored_date' at row 1:         
INSERT INTO merge_request_diff_commits (`message`, `authored_date`, 
`author_name`, `author_email`, `committed_date`, `committer_name`, 
`committer_email`, `merge_request_diff_id`, `relative_order`, `sha`)
        VALUES ('paid through date on receipt distribution. closes #21\n', '2017-
04-10T12:43:19.000-07:00'

Started upgrading from 10.3.0, 10.3.1, etc.

10.3.2 is where the incorrect datetime value error occurs. Can’t get past that.

It turned out to be funky data in the columns of merge_request_diffs which were being used to insert rows into merge_request_diff_commits and merge_request_diff_files in migrations.

After identifying the offending rows in merge_request_diffs and clobbering them (as well as their parent rows in merge_requests) I was able to upgrade to 12.0.12: the end of the line for MySQL.

I now have a reasonable expectation of being able to migrate to PostrgreSQL and upgrade to the current version.