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)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay