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.
13 lines
390 B
Ruby
13 lines
390 B
Ruby
class AddGroupIdToLabels < ActiveRecord::Migration
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
DOWNTIME = false
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def change
|
|
add_column :labels, :group_id, :integer
|
|
add_foreign_key :labels, :namespaces, column: :group_id, on_delete: :cascade # rubocop: disable Migration/AddConcurrentForeignKey
|
|
add_concurrent_index :labels, :group_id
|
|
end
|
|
end
|