gitlab-org--gitlab-foss/db/migrate/20180405142733_create_project_deploy_tokens.rb
Mayra Cabrera 2991381630 Addresses database comments
- Adds a default on expires_at datetime
- Modifies deploy tokens views to handle default expires at value
- Use datetime_with_timezone where possible
- Remove unused scopes
2018-04-06 21:20:17 -05:00

16 lines
515 B
Ruby

class CreateProjectDeployTokens < ActiveRecord::Migration
DOWNTIME = false
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
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