766060bcdf
This adds a Rubocop rule to enforce the use of add_concurrent_foreign_key instead of the regular add_foreign_key method. This cop has been disabled for existing migrations so we don't need to change those.
14 lines
403 B
Ruby
14 lines
403 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 # rubocop: disable Migration/AddConcurrentForeignKey
|
|
end
|
|
|
|
def down
|
|
remove_column :subscriptions, :project_id
|
|
end
|
|
end
|