Skip to content

Adds validation for schema_migration prior to truncate.

username-removed-293650 requested to merge mysql_validate_pre_truncate into master

What does this MR do?

Confirms the schema_migrationstable exists before running truncate.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Restoring a GitLab backup to an empty MySQL database fails with:

ActiveRecord::StatementInvalid: Mysql2::Error: Table 'gitlab.schema_migrations' doesn't exist: TRUNCATE schema_migrations

Example at: ZD: https://gitlab.zendesk.com/agent/tickets/35466

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports