class CreateChapters
Public Instance Methods
change()
click to toggle source
# File lib/generators/dummy/templates/migrations/create_chapters.rb, line 2 def change create_table :chapters do |t| t.string :title, :null => false t.text :text t.text :sample_html t.integer :book_id t.integer :item_position t.timestamps(null: false) end add_index :chapters, :book_id end