Class: CreateComments
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateComments
- Defined in:
- lib/generators/jabe/templates/migrations/create_comments.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
16 17 18 19 |
# File 'lib/generators/jabe/templates/migrations/create_comments.rb', line 16 def self.down remove_index :comments, :entry_id drop_table :comments end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/jabe/templates/migrations/create_comments.rb', line 2 def self.up create_table :comments do |t| t.integer :entry_id t.string :name t.string :email t.string :url t.text :body t. end add_index :comments, :entry_id end |