diff --git a/app/models/project_category.rb b/app/models/project_category.rb index 6da12560d..256b0cd1b 100644 --- a/app/models/project_category.rb +++ b/app/models/project_category.rb @@ -1,2 +1,3 @@ class ProjectCategory < ApplicationRecord + has_ancestry end diff --git a/db/migrate/20191218021144_add_ancestry_to_project_categories.rb b/db/migrate/20191218021144_add_ancestry_to_project_categories.rb new file mode 100644 index 000000000..e08606ee9 --- /dev/null +++ b/db/migrate/20191218021144_add_ancestry_to_project_categories.rb @@ -0,0 +1,6 @@ +class AddAncestryToProjectCategories < ActiveRecord::Migration[5.2] + def change + add_column :project_categories, :ancestry, :string + add_index :project_categories, :ancestry + end +end