Updated GroupCategory functionality with Groups

• Updated:
- GroupCategory functionality with Groups
This commit is contained in:
mgabdev
2020-09-10 17:12:43 -05:00
parent 217aab9faa
commit 6e17b7c17b
10 changed files with 53 additions and 13 deletions

View File

@@ -0,0 +1,5 @@
class RemoveGroupCategoriesIdFromGroup < ActiveRecord::Migration[5.2]
def change
safety_assured { remove_column :groups, :group_categories_id }
end
end

View File

@@ -0,0 +1,6 @@
class AddForeignKeyToGroupForGroupCategory < ActiveRecord::Migration[5.2]
def change
add_column :groups, :group_category_id, :integer
add_foreign_key :groups, :group_categories, on_delete: :nullify, validate: false
end
end

View File

@@ -0,0 +1,5 @@
class ValidateAddForeignKeyToGroupForGroupCategory < ActiveRecord::Migration[5.2]
def change
validate_foreign_key :groups, :group_categories
end
end