Sha256: c89cbcf216f872d3e5d14a511ff92c2f30d944161d0bd8ff69b9ffdd5dcccf88
Contents?: true
Size: 811 Bytes
Versions: 58
Compression:
Stored size: 811 Bytes
Contents
# frozen_string_literal: true class RemoveVisibleFromAlchemyPages < ActiveRecord::Migration[5.2] class LocalPage < ActiveRecord::Base self.table_name = "alchemy_pages" scope :invisible, -> { where(visible: [false, nil]) } scope :contentpages, -> { where(layoutpage: [false, nil]) } end def up if LocalPage.invisible.contentpages.where.not(parent_id: nil).any? abort "You have invisible pages in your database! " \ "Please re-structure your page tree before running this migration. " \ "You might also downgrade to Alchemy 4.6 and " \ "run the `alchemy:upgrade:4.6:restructure_page_tree` rake task." end remove_column :alchemy_pages, :visible end def down add_column :alchemy_pages, :visible, :boolean, default: false end end
Version data entries
58 entries across 58 versions & 1 rubygems