# Error when creating table "left" in migration

**URL:** <https://www.ruby-forum.com/t/error-when-creating-table-left-in-migration/59198>\
**Category:** Rails\
**Created:** [May 1, 2006, 12:04pm UTC](https://www.ruby-forum.com/t/error-when-creating-table-left-in-migration/59198 "2006-05-01T12:04:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [May 1, 2006, 12:04pm UTC](https://www.ruby-forum.com/t/error-when-creating-table-left-in-migration/59198/1 "2006-05-01T12:04:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/error-when-creating-table-left-in-migration/59198/2 "2006-05-03T18:57:14Z")

</div>

> 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](http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html)

–  
Darren Beale

> **[Darren Beale (Bealers)](https://bealers.com/)**
>
> I am Darren Beale, founder of Siftware. Over the past 20+ years, I have helped countless people and organisations make money on the web. Is it your turn, do you want help getting your stuff online? Do you want to pick my brains about building new...

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [May 5, 2006, 8:20am UTC](https://www.ruby-forum.com/t/error-when-creating-table-left-in-migration/59198/3 "2006-05-05T08:20:40Z")

</div>

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](http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html)
> 
> –  
> Darren Beale  
> [http://bealers.com](http://bealers.com)
