summaryrefslogtreecommitdiff
path: root/db/migrate/20230412073614_create_issue_assignment_events.rb
blob: 1b57c59eb2be9b5e00409ba6a565b44b646da227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

class CreateIssueAssignmentEvents < Gitlab::Database::Migration[2.1]
  def change
    create_table :issue_assignment_events do |t|
      t.references :user, null: true, index: true, foreign_key: { on_delete: :nullify }
      t.bigint :issue_id, null: false
      t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' }
      t.integer :action, limit: 2, null: false, default: 1

      t.index %i[issue_id action created_at id], name: 'index_on_issue_assignment_events_issue_id_action_created_at_id'
    end
  end
end