Suppose you already have a database with a table named candy and now you want to start using migrations. If you try to run a migration with a pre-existing table, Rails will error. So by placing :force => true, you are forcefully wiping the table. After you've performed your migration, you normally want to return the Boolean to false.
- class CreateCandy < ActiveRecord::Migration
- def self.up
- create_table :candies, :force => true do |t|
- t.string :name
- t.string :type
- def self.down
- drop_table :candies
You need to login to post a comment.