diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 18:42:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 18:42:17 +0300 |
commit | 44fdf983bd35328dd577d3d3650d14163ef3e2b6 (patch) | |
tree | 84ff300d056cfbabb5a0fe2a9cbaa80aaeab1cc5 /db/migrate | |
parent | bc9fa07b26184b5c94808f704db6ea1ac81bf4de (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'db/migrate')
4 files changed, 74 insertions, 0 deletions
diff --git a/db/migrate/20200325104755_add_push_rules_id_to_project_settings.rb b/db/migrate/20200325104755_add_push_rules_id_to_project_settings.rb new file mode 100644 index 00000000000..93de736436b --- /dev/null +++ b/db/migrate/20200325104755_add_push_rules_id_to_project_settings.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddPushRulesIdToProjectSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + add_column :project_settings, :push_rule_id, :bigint + end + end + + def down + with_lock_retries do + remove_column :project_settings, :push_rule_id + end + end +end diff --git a/db/migrate/20200325104756_add_push_rules_foreign_key_to_project_settings.rb b/db/migrate/20200325104756_add_push_rules_foreign_key_to_project_settings.rb new file mode 100644 index 00000000000..41ad8d73b4c --- /dev/null +++ b/db/migrate/20200325104756_add_push_rules_foreign_key_to_project_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddPushRulesForeignKeyToProjectSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + disable_ddl_transaction! + + def up + add_concurrent_index :project_settings, :push_rule_id, unique: true + add_concurrent_foreign_key :project_settings, :push_rules, column: :push_rule_id, on_delete: :cascade + end + + def down + remove_foreign_key_if_exists :project_settings, column: :push_rule_id + remove_concurrent_index :project_settings, :push_rule_id + end +end diff --git a/db/migrate/20200325104833_add_push_rules_id_to_application_settings.rb b/db/migrate/20200325104833_add_push_rules_id_to_application_settings.rb new file mode 100644 index 00000000000..4650f1734c0 --- /dev/null +++ b/db/migrate/20200325104833_add_push_rules_id_to_application_settings.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddPushRulesIdToApplicationSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + add_column :application_settings, :push_rule_id, :bigint + end + end + + def down + with_lock_retries do + remove_column :application_settings, :push_rule_id + end + end +end diff --git a/db/migrate/20200325104834_add_push_rules_foreign_key_to_application_settings.rb b/db/migrate/20200325104834_add_push_rules_foreign_key_to_application_settings.rb new file mode 100644 index 00000000000..5263250833d --- /dev/null +++ b/db/migrate/20200325104834_add_push_rules_foreign_key_to_application_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddPushRulesForeignKeyToApplicationSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + disable_ddl_transaction! + + def up + add_concurrent_index :application_settings, :push_rule_id, unique: true + add_concurrent_foreign_key :application_settings, :push_rules, column: :push_rule_id, on_delete: :nullify + end + + def down + remove_concurrent_index :application_settings, :push_rule_id + remove_foreign_key_if_exists :application_settings, column: :push_rule_id + end +end |