From d779bd78a723c29b180e8b08aead074f5b8f5579 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 18 Dec 2019 10:16:26 +0800 Subject: [PATCH] ADD a field 'ancestry' to project_categories table --- app/models/project_category.rb | 1 + .../20191218021144_add_ancestry_to_project_categories.rb | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 db/migrate/20191218021144_add_ancestry_to_project_categories.rb 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