class CreatePhotoAlbums < ActiveRecord::Migration[5.1] def change create_table :dhatu_photo_albums do |t| t.string :name, :null => false, limit: 128 t.string :code, :null => false, limit: 128 t.string :one_liner t.string :permalink, :null => false, limit: 128 t.text :description t.references :parent, references: :category t.references :top_parent, references: :category t.boolean :end_node, default: true t.string :status, :null => false, :default=>"unpublished", :limit=>16 t.boolean :featured, default: false t.integer :priority, default: 1, null: false t.timestamps null: false end add_index :dhatu_photo_albums, :permalink, :unique => true add_index :dhatu_photo_albums, :status end end