I added a table to my local env called schools
and it works fine in dev. In fact it even works fine in staging (heroku) but fails big time in production and rake db:migrate
throws the error bellow.
I cannot even precompile assest (with RAILS_ENV=production), access any part of my application including the rails console in production(heroku). Everything is throwing the error bellow. I have lost several hours on this but do not feel any closer to figuring it our. (Note: I have '"..."'
on the reference to the table_name which I think is part of the problem)
I went from rails 3.1.0 to 3.1.3 so that might have something to do with it.
PGError: ERROR: relation "schools" does not exist
LINE 4: WHERE a.attrelid = '"schools"'::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 = '"schools"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
I am as lost as can be on this. I read several other questions on this topic here but no solution at sight. Thank you for your help. Any insight is greatly appreciated.
UPDATE------------------------------------------------------
I just created a brand new app on heroku and ran rake db:migrate
and got the same error.
UPDATE 2
I cloned the app from heroku and "schools" is in the schema.
create_table "schools", :force => true do |t|
...
...
end
UPDATE 3
Tried reverting back to rails 3.1.0 but that did not help.
UPDATE 4
Still working on this. Have not heard from heroku support yet.
UPDATE 5
Heroku support was able to check that 'schools' is not a table in the DB but I still cannot access the console and app still down.