Error when creating table "left" in migration

Hi,

I am getting an error when running a migration that is supposed to
create tables called “bottom”, “top”, “left” and “right”. Since “bottom”
and “top” work just fine, my hunch is that in the SQL the “left” is
mistaken for some join statement like “LEFT INNER JOIN”.

Couln’t one consider that a Rails bug? Shouldn’t Rails be able to escape
names that match SQL keywords? Or is it in fact not possible to create
tables named like that?

And is there any way work around this?

Ingo W.

I am getting an error when running a migration that is supposed to
create tables called “bottom”, “top”, “left” and “right”. Since “bottom”
and “top” work just fine, my hunch is that in the SQL the “left” is
mistaken for some join statement like “LEFT INNER JOIN”.

Do you already have a table called Left?

It’s a MySQL reserved word (for v5 anyway)
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html


Darren Beale
http://bealers.com

Hi Darren,

no I did not have a “left” table yet. Sounds like it’s not an accepted
table name, and I ended up calling it bounds_left instead

Thanks!
Ingo

Darren Beale wrote:

I am getting an error when running a migration that is supposed to
create tables called “bottom”, “top”, “left” and “right”. Since “bottom”
and “top” work just fine, my hunch is that in the SQL the “left” is
mistaken for some join statement like “LEFT INNER JOIN”.

Do you already have a table called Left?

It’s a MySQL reserved word (for v5 anyway)
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html


Darren Beale
http://bealers.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs