rake db:create create also a phantom table

16 views
Skip to first unread message

apsr84

unread,
Dec 18, 2014, 5:10:05 AM12/18/14
to rubyonra...@googlegroups.com

Hello guys,

today happened a strange thing, i have a Rails 4 application which use a sql structure (use Postgres), no migrations at all; after some testing i dropped and recreated the db with rake db:drop and db:create, but i had an error loading the structure, on the last table i was working on, it was already there ...  looks like the db:create task created that table, only that one, each time.

I checked and cleared all definitions of that table i had written, and all the caching im aware of, but still happens every time.
It's not a big deal, easly solved without effort, but still ... having something going on, which i don't know why it is, is unaceptable and i need to understand and fix what i missed.

Any idea or suggestion ? Where or how that could happen ?

ps. I have quickly checked the source code but i have other priorities, can't lose hours into this now, in the weekend ill dig deeper ...


Vivek Sampara

unread,
Dec 19, 2014, 2:07:05 AM12/19/14
to rubyonra...@googlegroups.com
Hi, 

This happens because of Schema cache dump  . http://edgeguides.rubyonrails.org/4_0_release_notes.html#general. To avoid this you need to run 

rake db:schema:cache:clear

Cheers
Vivek

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3da4a136-31ec-40f4-96f2-2ff30100157d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages