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