Sha256: dbe8b3293ecfeefe299b7518485a193d5860d12962fef7a3a3016b224324eee6

Contents?: true

Size: 693 Bytes

Versions: 7

Compression:

Stored size: 693 Bytes

Contents

class CreateStructures < ActiveRecord::Migration
  def self.up
    create_table :structures do |t|
      t.string :slug, null: false
      t.integer :kind, limit: 1, default: 1
      t.integer :position, limit: 2, default: 1
      t.references :user
      t.boolean :is_visible, default: true, null: false

      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, :user_id
    add_index :structures, [:slug, :kind], unique: true
    add_index :structures, :parent_id
    add_index :structures, [:lft, :rgt]
  end

  def self.down
    drop_table :structures
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.3.6 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.5 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.4 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.3 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.2 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.1 db/migrate/20130101000006_create_structures.rb
ab_admin-0.3.0 db/migrate/20130101000006_create_structures.rb