diff options
author | Reuben Pereira <rpereira@gitlab.com> | 2019-08-07 21:40:36 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-07 21:40:36 +0300 |
commit | af4a597d3fb687ed2841bb755403f66cf131bdff (patch) | |
tree | 45b6188b5a67d4372b4073c41a420119d6300a89 /db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb | |
parent | d02003cf951692cc243b7ee512de2139e99f0c4c (diff) |
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/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb')
-rw-r--r-- | db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb | 14 |
1 files changed, 14 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 |