Read about our upcoming Code of Conduct on this issue

20170828093725_create_project_auto_dev_ops.rb 593 Bytes
Newer Older
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 CreateProjectAutoDevOps < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    create_table :project_auto_devops do |t|
      t.belongs_to :project, index: true
      t.boolean :enabled, default: true
      t.string :domain
    end

    add_timestamps_with_timezone(:project_auto_devops, null: false)

    # No need to check for violations as its a new table
    add_concurrent_foreign_key(:project_auto_devops, :projects, column: :project_id)
  end

  def down
    drop_table(:project_auto_devops)
  end
end