MySQL project_mirror_data.project_id can't be NULL while PostgreSQL can
In https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5594#note_71891126 we discovered this error:
ActiveRecord::StatementInvalid:
Mysql2::Error: Column 'project_id' cannot be null: INSERT INTO `project_mirror_data` (`status`, `last_update_at`, `project_id`, `created_at`, `updated_at`) VALUES ('failed', '2018-05-07 09:48:47', NULL, '2018-05-07 09:48:47', '2018-05-07 09:48:47')
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./config/initializers/active_record_locking.rb:15:in `_create_record'
# ./spec/factories/projects.rb:128:in `block (4 levels) in <top (required)>'
# ./spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb:88:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# Column 'project_id' cannot be null
# ./config/initializers/connection_fix.rb:20:in `execute'
in https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/66826313
We should figure out why and fix it.
Edited by Lin Jen-Shin