debian-mirror-gitlab/db/migrate/20161031171301_add_project_id_to_subscriptions.rb
2019-02-15 15:39:39 +05:30

15 lines
467 B
Ruby

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