Class: CreateChapters

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/dummy/templates/migrations/create_chapters.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



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.timestamps(null: false)
  end
  add_index :chapters, :book_id
end