Sha256: 81f81e94d798b41b66869efdc0be42b261b0df24c4a79abc5ec8ccc6c3490d33

Contents?: true

Size: 848 Bytes

Versions: 18

Compression:

Stored size: 848 Bytes

Contents

class SunriseCreateStructures < ActiveRecord::Migration
  def self.up
    create_table :structures do |t|
      t.string    :title, :null => false
      t.string    :slug, :null => false, :limit => 25
      t.integer   :kind, :limit => 1, :default => 0
      t.integer   :position, :limit => 2, :default => 0
      t.boolean   :is_visible, :default => true
      t.string    :redirect_url
      
      t.integer  "parent_id"
      t.integer  "lft",                          :default => 0
      t.integer  "rgt",                          :default => 0
      t.integer  "depth",                        :default => 0
      
      t.timestamps
    end
    
    add_index :structures, [:kind, :slug], :uniq => true
    add_index :structures, :parent_id
    add_index :structures, [:lft, :rgt]
  end

  def self.down
    drop_table :structures
  end
end

Version data entries

18 entries across 13 versions & 4 rubygems

Version Path
sunrise-core-0.2.2 spec/dummy/db/migrate/20110616102756_sunrise_create_structures.rb
sunrise-core-0.2.2 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.2.1 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.2.1 spec/tmp/db/migrate/20110819144750_sunrise_create_structures.rb
sunrise-core-0.2.1 spec/dummy/db/migrate/20110616102756_sunrise_create_structures.rb
sunrise-widgets-0.1.1 spec/dummy/db/migrate/20110801125009_sunrise_create_structures.rb
sunrise-locales-0.1.0 spec/dummy/db/migrate/20110801125009_sunrise_create_structures.rb
sunrise-core-0.2.0 spec/dummy/db/migrate/20110616102756_sunrise_create_structures.rb
sunrise-core-0.2.0 spec/tmp/db/migrate/20110819144750_sunrise_create_structures.rb
sunrise-core-0.2.0 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-widgets-0.1.0 spec/dummy/db/migrate/20110801125009_sunrise_create_structures.rb
sunrise-questions-0.1.0 spec/dummy/db/migrate/20110801125009_sunrise_create_structures.rb
sunrise-core-0.1.5 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.1.4 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.1.3 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.1.2 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.1.1 lib/generators/sunrise/templates/migrate/create_structures.rb
sunrise-core-0.1.0 lib/generators/sunrise/templates/migrate/create_structures.rb