From edfec24c1d7adefa03568c97b50f730a6196f9d2 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sun, 2 Feb 2020 09:08:55 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- ...3090839_remove_analytics_repository_table_fks_on_projects.rb | 2 +- ...e_analytics_repository_files_fk_on_other_analytics_tables.rb | 2 +- ...20200123091854_drop_analytics_repository_file_edits_table.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20200123090839_remove_analytics_repository_table_fks_on_projects.rb b/db/migrate/20200123090839_remove_analytics_repository_table_fks_on_projects.rb index a591596c74c..94fafe214c2 100644 --- a/db/migrate/20200123090839_remove_analytics_repository_table_fks_on_projects.rb +++ b/db/migrate/20200123090839_remove_analytics_repository_table_fks_on_projects.rb @@ -9,7 +9,7 @@ class RemoveAnalyticsRepositoryTableFksOnProjects < ActiveRecord::Migration[5.2] with_lock_retries do # Requires ExclusiveLock on all tables. analytics_* tables are empty remove_foreign_key :analytics_repository_files, :projects - remove_foreign_key :analytics_repository_file_edits, :projects + remove_foreign_key :analytics_repository_file_edits, :projects if table_exists?(:analytics_repository_file_edits) # this table might be already dropped on development environment remove_foreign_key :analytics_repository_file_commits, :projects end end diff --git a/db/migrate/20200123091422_remove_analytics_repository_files_fk_on_other_analytics_tables.rb b/db/migrate/20200123091422_remove_analytics_repository_files_fk_on_other_analytics_tables.rb index 60de2e9cb7f..e3e415dd0ad 100644 --- a/db/migrate/20200123091422_remove_analytics_repository_files_fk_on_other_analytics_tables.rb +++ b/db/migrate/20200123091422_remove_analytics_repository_files_fk_on_other_analytics_tables.rb @@ -8,7 +8,7 @@ class RemoveAnalyticsRepositoryFilesFkOnOtherAnalyticsTables < ActiveRecord::Mig def up with_lock_retries do # Requires ExclusiveLock on all tables. analytics_* tables are empty - remove_foreign_key :analytics_repository_file_edits, :analytics_repository_files + remove_foreign_key :analytics_repository_file_edits, :analytics_repository_files if table_exists?(:analytics_repository_file_edits) # this table might be already dropped on development environment remove_foreign_key :analytics_repository_file_commits, :analytics_repository_files end end diff --git a/db/migrate/20200123091854_drop_analytics_repository_file_edits_table.rb b/db/migrate/20200123091854_drop_analytics_repository_file_edits_table.rb index 3bb026727f4..59bf2dbdca3 100644 --- a/db/migrate/20200123091854_drop_analytics_repository_file_edits_table.rb +++ b/db/migrate/20200123091854_drop_analytics_repository_file_edits_table.rb @@ -7,7 +7,7 @@ class DropAnalyticsRepositoryFileEditsTable < ActiveRecord::Migration[5.2] def up # Requires ExclusiveLock on the table. Not in use, no records, no FKs. - drop_table :analytics_repository_file_edits + drop_table :analytics_repository_file_edits if table_exists?(:analytics_repository_file_edits) # this table might be already dropped on development environment end def down -- GitLab