gitlab-org--gitlab-foss/db/migrate/20180405142733_create_project_deploy_tokens.rb

17 lines
520 B
Ruby
Raw Normal View History

class CreateProjectDeployTokens < ActiveRecord::Migration[4.2]
DOWNTIME = false
2018-04-05 17:37:39 -04:00
def change
create_table :project_deploy_tokens do |t|
t.integer :project_id, null: false
t.integer :deploy_token_id, null: false
t.datetime_with_timezone :created_at, null: false
2018-04-05 17:37:39 -04:00
t.foreign_key :deploy_tokens, column: :deploy_token_id, on_delete: :cascade
t.foreign_key :projects, column: :project_id, on_delete: :cascade
t.index [:project_id, :deploy_token_id], unique: true
end
end
end