DEV Community

Tao Liu
Tao Liu

Posted on

PG::UndefinedTable: ERROR: relation "users" does not exist

rake db:migrate
== 20190928042042 CreatePosts: migrating ======================================
-- create_table(:posts)
-> 0.0422s
== 20190928042042 CreatePosts: migrated (0.0426s) =============================

== 20190928042817 CreateVotes: migrating ======================================
-- create_table(:votes)
`rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedTable: ERROR: relation "users" does not exist`

Solution:

run the single migration first
rake db:migrate:up VERSION=20090408054555
https://riptutorial.com/ruby-on-rails/example/3486/run-specific-migration

then run rake db:migrate

Top comments (0)