Class: CreatePosts
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreatePosts
- Defined in:
- lib/ecrire/db/migrate/20131111222709_create_posts.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
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. null: false end add_index :posts, :title, unique: true end |