Class: CreateChapters
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateChapters
- Defined in:
- lib/generators/dummy/templates/migrations/create_chapters.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# 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.(null: false) end add_index :chapters, :book_id end |