gitlab-org--gitlab-foss/db/migrate/20161031171301_add_project_id_to_subscriptions.rb
2016-11-17 15:10:12 -02:00

14 lines
350 B
Ruby

class AddProjectIdToSubscriptions < ActiveRecord::Migration
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
end
def down
remove_column :subscriptions, :project_id
end
end