Sha256: a43db6dce2c4f4cecabe8a3327cfe34b35ae06994bc6c8c31f4a037956f79e4a

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

class CreateStructures < ActiveRecord::Migration[5.2]
  def change
    create_table :structures do |t|
      t.string :slug, null: false
      t.integer :structure_type_id, limit: 1, default: 1
      t.integer :position_type_id, limit: 1, 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, [:slug, :structure_type_id], unique: true
    add_index :structures, :position_type_id
    add_index :structures, :parent_id
    add_index :structures, [:lft, :rgt]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ab_admin-0.11.0 db/migrate/20130101000006_create_structures.rb
ab_admin-0.10.0 db/migrate/20130101000006_create_structures.rb