Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrations are pending error while everything is up to date

I have a strange issue with migrations. The last migration file is: 20190826113704_add_percentage_account_to_contacts.rb.

The timestamp in schema.rb is ActiveRecord::Schema.define(version: 2019_08_26_113704).

So you would say everything is up to date. When I start the server and go to the site I get the Migrations are pending error. So when I run rails db:migrate I get an error relation "study_agreements" already exists which is correct, there are no migrations pending.

So how can I solve this?

like image 973
John Avatar asked Sep 13 '25 07:09

John


1 Answers

It seems you have already have a table in DB and you have down migrated file in your migrate folder. you can do 2 things here:

  1. Run rails db:schema:load OR
  2. If you don't have data in your db then run rails db:reset
like image 187
kishore cheruku Avatar answered Sep 14 '25 21:09

kishore cheruku