Note that there are some explanatory texts on larger screens.

plurals
  1. PODevise migration on existing model
    primarykey
    data
    text
    <p>I'm migrating from Authlogic to Devise. </p> <p>UPDATED: </p> <p>The migration of devise tries to re-create the table users, so i changed as you can see below the create_table to change_table and drop table at the end to remove what i add</p> <p>The problem is when I run rake i get an error .</p> <p>This is the error I get when running rake.</p> <pre><code>== DeviseCreateUsers: migrating ============================================== -- change_table(:users) rake aborted! An error has occurred, this and all later migrations canceled: SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar(255) DEFAULT '' NOT NULL </code></pre> <p>This is the migration</p> <pre><code>class DeviseCreateUsers &lt; ActiveRecord::Migration def self.up change_table(:users) do |t| t.database_authenticatable :null =&gt; false t.recoverable t.rememberable t.trackable # t.confirmable # t.lockable :lock_strategy =&gt; :failed_attempts, :unlock_strategy =&gt; :both # t.token_authenticatable t.timestamps end add_index :users, :email, :unique =&gt; true add_index :users, :reset_password_token, :unique =&gt; true # add_index :users, :confirmation_token, :unique =&gt; true # add_index :users, :unlock_token, :unique =&gt; true end def self.down remove_column :users, :database_authenticatable remove_column :users, :recoverable remove_column :users, :rememberable remove_column :users, :trackable remove_index :users, :email remove_index :users, :reset_password_token end end </code></pre> <p>In my schema.rb i already have this from Authlogic.</p> <pre><code> create_table "users", :force =&gt; true do |t| t.string "username" t.string "email" t.string "crypted_password" t.string "password_salt" t.string "persistence_token" </code></pre> <p>I think it sees some kind of conflict that i'm not able to realize how to avoid with those devise helpers</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload