summaryrefslogtreecommitdiff
path: root/db/migrate/20170322013926_create_container_repository.rb
blob: 91540bc88bd5927af4bb496fa0f5fd677fa745b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CreateContainerRepository < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def change
    create_table :container_repositories do |t|
      t.references :project, foreign_key: true, index: true, null: false
      t.string :name, null: false

      t.timestamps null: false
    end

    add_index :container_repositories, [:project_id, :name], unique: true
  end
end