Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

20180405142733_create_project_deploy_tokens.rb 639 Bytes
Newer Older
Mayra Cabrera's avatar
Mayra Cabrera committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class CreateProjectDeployTokens < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    create_table :project_deploy_tokens do |t|
      t.integer :project_id, null: false
      t.integer :deploy_token_id, null: false

      t.timestamps null: false
    end

    add_concurrent_index :project_deploy_tokens, [:project_id, :deploy_token_id]
  end

  def down
    drop_table :project_deploy_tokens

    remove_index :project_deploy_tokens, column: [:project_id, :deploy_token_id] if index_exists?(:project_deploy_tokens, [:project_id, :deploy_token_id])
  end
end