gitlab-org--gitlab-foss/db/migrate/20160919145149_add_group_id_to_labels.rb
Douglas Barbosa Alexandre d820c090ec Add GroupLabel model
2016-10-19 14:57:14 -02:00

13 lines
337 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
add_concurrent_index :labels, :group_id
end
end