Note that there are some explanatory texts on larger screens.

plurals
  1. POPGError: ERROR: column "email" of relation "users" already exists
    primarykey
    data
    text
    <p>I've been developing a website on localhost and it wors fine. This morning, I've tried to push it to heroku using the command "git push heroku master" and then "heroku run rake db:migrate". When I try to do the second one, I have an error:</p> <pre><code>Connecting to database specified by DATABASE_URL Migrating to DeviseCreateUsers (20130427200347) Migrating to CreateAuthentications (20130427210108) Migrating to AddTokenToAuth (20130427233400) Migrating to AddNotificationToAuth (20130427234836) Migrating to AddNotifToUser (20130428031013) Migrating to AddDeviseToUsers (20130712103048) == AddDeviseToUsers: migrating =============================================== -- change_table(:users) rake aborted! An error has occurred, this and all later migrations canceled: PGError: ERROR: column "email" of relation "users" already exists : ALTER TABLE "users" ADD COLUMN "email" character varying(255) DEFAULT '' NOT N sql_adapter.rb:652:in `async_exec' </code></pre> <p>I have found someone who had the same issue (<a href="https://stackoverflow.com/questions/13575225/heroku-pgerror-already-exists-500-were-sorry-but-something-went-wrong">heroku PGError: already exists 500 We&#39;re sorry, but something went wrong</a>) but in my case the migration "AddDeviseToUsers" is not in the 'db/migrate' folder.</p> <p>Previous migration affecting users table are :</p> <pre><code>class DeviseCreateUsers &lt; ActiveRecord::Migration def change create_table(:users) do |t| ## Database authenticatable t.string :email, :null =&gt; false, :default =&gt; "" t.string :encrypted_password, :null =&gt; false, :default =&gt; "" ## Recoverable t.string :reset_password_token t.datetime :reset_password_sent_at ## Rememberable t.datetime :remember_created_at ## Trackable t.integer :sign_in_count, :default =&gt; 0 t.datetime :current_sign_in_at t.datetime :last_sign_in_at t.string :current_sign_in_ip t.string :last_sign_in_ip ## Token authenticatable # t.string :authentication_token t.timestamps end add_index :users, :email, :unique =&gt; true add_index :users, :reset_password_token, :unique =&gt; true end end </code></pre> <p>and</p> <pre><code>class AddNotifToUser &lt; ActiveRecord::Migration def change add_column :users, :notif, :string end end </code></pre> <p>Thanks in advance !!</p> <p><strong>Edit - answering comments</strong> when I run : heroku run rake db:migrate:status</p> <pre><code>up 20130427200347 Devise create users up 20130427210108 Create authentications up 20130427233400 Add token to auth up 20130427234836 Add notification to auth up 20130428031013 Add notif to user down 20130712103048 Add devise to users down 20130719091217 Create relationships . . . </code></pre>
    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.
    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