RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

PG::DuplicateTable: ERROR: relation "payola_sales" already exists #156

Open Hatcher19 opened 8 years ago

Hatcher19 commented 8 years ago

PG::DuplicateTable: ERROR: relation "payola_sales" already exists

I'm getting this error after I migrate my DB in heroku. Not sure where to find this migration. All my new migrations haven't run and has left my production site in limbo. A few searches on the new and i wasnt able to find anything. Any help would be appreciated.

Hatcher19 commented 8 years ago

I ended up working around it. I ran heroku run rake db:migrate:status to see the migrations that were down and then i ran heroku run rake db:migrate:up VERSION=XXX. not a long term solution.

MugOfPaul commented 7 years ago

Actual problem appears that the schema.rb already has the payola tables in it but the migration is in the queue (specifically 20141001170138 CreatePayolaSales) to create the tables. Easiest fix was to delete all the payola tables in schema.rb and I ran rake db:drop && rake db:setup && rake db:migrate just to be safe. Now it seems to be clear.