class CreateGalleries < ActiveRecord::Migration[4.2]
  def change
    create_table :galleries do |t|
      t.references :gallery_category,:null=>false
      t.string :title,:null=>false
      t.string :photo,:null=>false
      t.text :content,:null=>false
      t.boolean :enable, :null=>false, :default=>true      
      t.timestamps null: false
    end

    add_index :galleries, :gallery_category_id
  end
end
