Adds validation for schema_migration prior to truncate.

Open 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:

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?