Skip to content

Navigation Menu

Sign up

How To: Upgrade to Devise 2.0 migration schema style

josevalim edited this page Dec 5, 2011 · 8 revisions

Since Devise 2.0, it no longer includes helpers for your migrations. Instead, it simply lists the database fields explicitly. This page shows the before and after of the migrations so you can easily compare and update your code.

Active Record

Before

 create_table(TABLE_NAME) do |t|
 t.database_authenticatable :null => false
 t.recoverable
 t.rememberable
 t.trackable
 
 # t.encryptable
 # t.confirmable
 # t.lockable :lock_strategy => :<%= Devise.lock_strategy %>, :unlock_stra
 # t.token_authenticatable
 end

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /