debian-mirror-gitlab/db/migrate/20220524141800_create_audit_events_streaming_headers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
823 B
Ruby
Raw Normal View History

2022-07-23 23:45:48 +05:30
# frozen_string_literal: true
class CreateAuditEventsStreamingHeaders < Gitlab::Database::Migration[2.0]
INDEX_NAME = 'idx_streaming_headers_on_external_audit_event_destination_id'
UNIQ_INDEX_NAME = 'idx_external_audit_event_destination_id_key_uniq'
def change
create_table :audit_events_streaming_headers do |t|
t.timestamps_with_timezone null: false
t.references :external_audit_event_destination,
null: false,
index: { name: INDEX_NAME },
foreign_key: { to_table: 'audit_events_external_audit_event_destinations', on_delete: :cascade }
t.text :key, null: false, limit: 255
t.text :value, null: false, limit: 255
t.index [:key, :external_audit_event_destination_id], unique: true, name: UNIQ_INDEX_NAME
end
end
end