diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /db/migrate/20201124030537_create_incident_management_on_call_rotations.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'db/migrate/20201124030537_create_incident_management_on_call_rotations.rb')
-rw-r--r-- | db/migrate/20201124030537_create_incident_management_on_call_rotations.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrate/20201124030537_create_incident_management_on_call_rotations.rb b/db/migrate/20201124030537_create_incident_management_on_call_rotations.rb new file mode 100644 index 00000000000..18546d97fd5 --- /dev/null +++ b/db/migrate/20201124030537_create_incident_management_on_call_rotations.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class CreateIncidentManagementOnCallRotations < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + unless table_exists?(:incident_management_oncall_rotations) + with_lock_retries do + create_table :incident_management_oncall_rotations do |t| + t.timestamps_with_timezone + t.references :oncall_schedule, index: false, null: false, foreign_key: { to_table: :incident_management_oncall_schedules, on_delete: :cascade } + t.integer :length, null: false + t.integer :length_unit, limit: 2, null: false + t.datetime_with_timezone :starts_at, null: false + t.text :name, null: false + + t.index %w(oncall_schedule_id id), name: 'index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_id', unique: true, using: :btree + t.index %w(oncall_schedule_id name), name: 'index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_name', unique: true, using: :btree + end + end + end + + add_text_limit :incident_management_oncall_rotations, :name, 200 + end + + def down + with_lock_retries do + drop_table :incident_management_oncall_rotations + end + end +end |