Sha256: a8532c2e1d56f25d3dee17ba139d543e4a43bac4608d411df502b3db9c2377de

Contents?: true

Size: 927 Bytes

Versions: 10

Compression:

Stored size: 927 Bytes

Contents

class Bare4Sidebar < ActiveRecord::Base
  include BareMigration

  # there's technically no need for these serialize declaration because in
  # this script active_config and staged_config will always be NULL anyway.
  serialize :active_config
  serialize :staged_config
end

class AddSidebars < ActiveRecord::Migration
  def self.up
    STDERR.puts "Creating sidebars"
    Bare4Sidebar.transaction do
      create_table :sidebars do |t|
        t.column :controller, :string
        t.column :active_position, :integer
        t.column :active_config, :text
        t.column :staged_position, :integer
        t.column :staged_config, :text
      end

      Bare4Sidebar.create(:active_position=>0, :controller=>'category')
      Bare4Sidebar.create(:active_position=>1, :controller=>'static')
      Bare4Sidebar.create(:active_position=>2, :controller=>'xml')
    end
  end

  def self.down
    drop_table :sidebars
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
typo-3.99.0 db/migrate/004_add_sidebars.rb
typo-3.99.2 db/migrate/004_add_sidebars.rb
typo-3.99.1 db/migrate/004_add_sidebars.rb
typo-3.99.3 db/migrate/004_add_sidebars.rb
typo-4.0.0 db/migrate/004_add_sidebars.rb
typo-4.0.1 db/migrate/004_add_sidebars.rb
typo-4.0.2 db/migrate/004_add_sidebars.rb
typo-3.99.4 db/migrate/004_add_sidebars.rb
typo-4.0.3 db/migrate/004_add_sidebars.rb
typo-4.1 db/migrate/004_add_sidebars.rb