Take the 2-minute tour ×

After i run heroku run db:migrate , i got this error . . the app works fine in development.i also did some research on this website , and try several solutions , seems not working.can somebody help me figure out how i can fix that ?

-- create_table(:pins)
NOTICE:  CREATE TABLE will create implicit sequence "pins_id_seq1" for serial column "pins.id"
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR:  relation "pins" already exists
: CREATE TABLE "pins" ("id" serial primary key, "description" character varying(255), "created_at" timestamp N
OT NULL, "updated_at" timestamp NOT NULL) /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_re
cord/connection_adapters/postgresql_adapter.rb:650:in `exec'
share|improve this question

1 Answer 1

up vote 0 down vote accepted

So this is telling you that pins already exists. It could be that you have two migrations that create pins or the somehow you've managed to create a table without Rails knowing/remembering that it's run the migration. I've found you can get into this state if you use heroku db:push to push a single table, in this case pins to Heroku but not the contents of schema_migrations so when you try and run the migration the table is present.

If it's new and you don't have any data in pins you can use psql, pgadmin tools etc to drop the pins table, re-run the migration and have Rails execute the migration and store the fact it has done it (it stores the ident of the migration in schema_migrations table)

share|improve this answer

Your Answer


