gitlab-org--gitlab-foss/db/migrate/20161031171301_add_project_id_to_subscriptions.rb

16 lines
467 B
Ruby
Raw Normal View History

class AddProjectIdToSubscriptions < ActiveRecord::Migration[4.2]
2016-10-31 13:40:27 -04:00
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
add_column :subscriptions, :project_id, :integer
add_foreign_key :subscriptions, :projects, column: :project_id, on_delete: :cascade # rubocop: disable Migration/AddConcurrentForeignKey
2016-10-31 13:40:27 -04:00
end
def down
remove_foreign_key :subscriptions, column: :project_id
2016-10-31 13:40:27 -04:00
remove_column :subscriptions, :project_id
end
end