diff options
author | Reuben Pereira <rpereira@gitlab.com> | 2019-08-07 18:40:36 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-07 18:40:36 +0000 |
commit | af4a597d3fb687ed2841bb755403f66cf131bdff (patch) | |
tree | 45b6188b5a67d4372b4073c41a420119d6300a89 /db | |
parent | d02003cf951692cc243b7ee512de2139e99f0c4c (diff) | |
download | gitlab-ce-af4a597d3fb687ed2841bb755403f66cf131bdff.tar.gz |
Save instance administration project id in DB
- This will make it easy to identify the project even if admins change
the name of the project or move it.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb | 14 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb b/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb new file mode 100644 index 00000000000..ce249a527e6 --- /dev/null +++ b/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddColumnForSelfMonitoringProjectId < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + add_reference( + :application_settings, + :instance_administration_project, + index: { name: 'index_applicationsettings_on_instance_administration_project_id' }, + foreign_key: { to_table: :projects, on_delete: :nullify } + ) + end +end diff --git a/db/schema.rb b/db/schema.rb index 2fac2c01e00..890f4ab4d8a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -230,9 +230,11 @@ ActiveRecord::Schema.define(version: 2019_08_02_235445) do t.integer "raw_blob_request_limit", default: 300, null: false t.boolean "allow_local_requests_from_web_hooks_and_services", default: false, null: false t.boolean "allow_local_requests_from_system_hooks", default: true, null: false + t.bigint "instance_administration_project_id" t.string "snowplow_collector_hostname" t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id" t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id" + t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id" t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id" end @@ -3623,6 +3625,7 @@ ActiveRecord::Schema.define(version: 2019_08_02_235445) do add_foreign_key "application_settings", "namespaces", column: "custom_project_templates_group_id", on_delete: :nullify add_foreign_key "application_settings", "projects", column: "file_template_project_id", name: "fk_ec757bd087", on_delete: :nullify + add_foreign_key "application_settings", "projects", column: "instance_administration_project_id", on_delete: :nullify add_foreign_key "application_settings", "users", column: "usage_stats_set_by_user_id", name: "fk_964370041d", on_delete: :nullify add_foreign_key "approval_merge_request_rule_sources", "approval_merge_request_rules", on_delete: :cascade add_foreign_key "approval_merge_request_rule_sources", "approval_project_rules", on_delete: :cascade |