rake db:create create also a phantom table

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 …

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