Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.1.3] PGError: ERROR: relation does not exist #4426

Closed
ExReanimator opened this issue Jan 12, 2012 · 2 comments
Closed

[3.1.3] PGError: ERROR: relation does not exist #4426

ExReanimator opened this issue Jan 12, 2012 · 2 comments

Comments

@ExReanimator
Copy link

Migration doesn't create table.

Migration works great, no errors.

$rake db:migrate
==  CreateEvents: migrating ===================================================
-- create_table(:events)
NOTICE:  CREATE TABLE will create implicit sequence "events_id_seq" for serial column "events.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "events_pkey" for table "events"
    -> 0.0120s
==  CreateEvents: migrated (0.0125s) ==========================================

But after that, got an error:

PGError: ERROR:  relation "events" does not exist
LINE 4:              WHERE a.attrelid = '"events"'::regclass
                                    ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
          FROM pg_attribute a LEFT JOIN pg_attrdef d
            ON a.attrelid = d.adrelid AND a.attnum = d.adnum
         WHERE a.attrelid = '"events"'::regclass
           AND a.attnum > 0 AND NOT a.attisdropped
         ORDER BY a.attnum

And if to look into a database there is no table "events".
It's appear in production mode.

@Houdini
Copy link
Contributor

Houdini commented Jul 1, 2012

What was the solution? I have same issue here.
Rails try to get model before tables were actually created

@ExReanimator
Copy link
Author

rake db:migrate RAILS_ENV=production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants