Project

General

Profile

Actions

Defect #34002

closed

postgres bundle exec rake db:migrate fails

Added by Marco Descher about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Executing RAILS_ENV=production bundle exec rake db:migrate on a new postgres database (psql (PostgreSQL) 11.7 (Debian 11.7-0+deb10u1) fails with

rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "users" does not exist
LINE 8:                WHERE a.attrelid = '"users"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                     c.collname, col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a
                LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                LEFT JOIN pg_type t ON a.atttypid = t.oid
                LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
               WHERE a.attrelid = '"users"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
/var/lib/gems/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in `async_exec'
/var/lib/gems/2.5.0/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:63:in `block (2 levels) in query'
/var/lib/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/var/lib/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/var/lib/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
...
Actions

Also available in: Atom PDF