Sha256: a570f93b0f20523353b1f0ce04d585ba4eaec15ee81b5b01f7acdd70d658932b

Contents?: true

Size: 604 Bytes

Versions: 30

Compression:

Stored size: 604 Bytes

Contents

class RemoveSidebarStagedConfig < ActiveRecord::Migration
  class BareSidebar < ActiveRecord::Base
    include BareMigration
    serialize :active_config
    serialize :staged_config
  end


  def self.up
    remove_column :sidebars, :staged_config
    rename_column :sidebars, :active_config, :config
  end

  def self.down
    modify_tables_and_update([:rename_column, BareSidebar, :config, :active_config],
                             [:add_column,    BareSidebar, :staged_config, :text]) do |sb|
      unless $schema_generator
        sb.staged_config = sb.active_config
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
typo-5.5 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.4.4 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.4.3 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.4.2 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.4.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.4 db/migrate/042_remove_sidebar_staged_config.rb
typo-3.99.0 db/migrate/042_remove_sidebar_staged_config.rb
typo-3.99.3 db/migrate/042_remove_sidebar_staged_config.rb
typo-3.99.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-3.99.2 db/migrate/042_remove_sidebar_staged_config.rb
typo-3.99.4 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.0.2 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.0.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.0.0 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.0.3 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.1.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.0.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-4.1 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.0.2 db/migrate/042_remove_sidebar_staged_config.rb
typo-5.0.3.98.1 db/migrate/042_remove_sidebar_staged_config.rb