class CreateNews < ActiveRecord::Migration
  def change
    create_table :news do |t|
      t.datetime :published_on
      t.references :user
      t.string :photo
      t.string :slug
      t.string :title
      t.text :content

      t.timestamps
    end

    add_index :news, :user_id
    add_index :news, :slug, unique: true
  end
end
