Sha256: 4cc190faaf81dbc56539924fe3eeb9a774e3427446cd9267a898a096e1ce88ce
Contents?: true
Size: 1.13 KB
Versions: 8
Compression:
Stored size: 1.13 KB
Contents
class AddNestedToProductCategories < ActiveRecord::Migration def up add_column :shoppe_product_categories, :parent_id, :integer add_column :shoppe_product_categories, :lft, :integer add_column :shoppe_product_categories, :rgt, :integer add_column :shoppe_product_categories, :depth, :integer add_index :shoppe_product_categories, :lft add_index :shoppe_product_categories, :rgt add_column :shoppe_product_categories, :ancestral_permalink, :string add_column :shoppe_product_categories, :permalink_includes_ancestors, :boolean, default: false Shoppe::ProductCategory.reset_column_information Shoppe::ProductCategory.rebuild! end def down remove_column :shoppe_product_categories, :ancestral_permalink remove_column :shoppe_product_categories, :permalink_includes_ancestors remove_index :shoppe_product_categories, :lft remove_index :shoppe_product_categories, :rgt remove_column :shoppe_product_categories, :parent_id remove_column :shoppe_product_categories, :lft remove_column :shoppe_product_categories, :rgt remove_column :shoppe_product_categories, :depth end end
Version data entries
8 entries across 8 versions & 2 rubygems