Class: CreatePosts

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/ecrire/db/migrate/20131111222709_create_posts.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ecrire/db/migrate/20131111222709_create_posts.rb', line 2

def change
  create_table :posts do |t|

    t.string :title, null: false
    t.string :slug, null: false
    t.text :content
    t.text :stylesheet

    t.datetime :published_at
    t.timestamps null: false

  end
  add_index :posts, :title, unique: true
end