Devalot and MySQL

1 view
Skip to first unread message

Isaac

unread,
Feb 7, 2008, 11:12:52 PM2/7/08
to Devalot
Welcome everyone to the new group! Some of us had been carrying on a
conversation in e-mail, so I will repost the gist of it in our new
group.

I have an installation of Devalot on Dreamhost. There
timeline_entries table, created in migration 18, failed to create
because it has a field named "change" which conflicts with a MySQL
keyword. This problem did not occur in my Postgresql installations,
and from what Sam Lown has told me, it may not occur in all versions
of MySQL.

Executing this command to add the "change" field to a table on MySQL
on Dreamhost fails:

alter table foo add column change varchar(255);

Wrapping the "change" field in backticks (not quotes or single-quotes)
succeeds:

alter table foo add column `change` varchar(255);

Now the discussion is whether we should rename the "change" field to
something that does not conflict with an SQL keyword.

We also need to figure out how to patch migration 18 to not break with
MySQL and add a new migration that renames the field.

That's pretty much where we left off.

IF

Sam Lown

unread,
Feb 8, 2008, 7:20:30 AM2/8/08
to Devalot
Hi Isaac. To save you a bit of effort, I'll post a summary of our last
comments.

I have indeed installed Devalot direct from SVN on several servers
with no problems at all regarding the migrations and column names. All
the systems are Debian/Ubuntu based and use the 5.0.XX series of
MySQL.

Nonetheless, according to the MySQL reserved word list [1] change
should not really be used in tables, a mistale on my part I afraid.

My suggestion is to modify the original migration (018) so that
"change" is renamed to something else, and create a second migration
which checks to see if the change has already happened and rename if
appropriate. Not ideal, but should solve the problem of broken
migrations which I think is more important.

I'll see if I can add this migration as soon as possible and make the
necessary alterations to the code. Hopefully we'll be on Git soon
too? :-)

Cheers, sam

[1] http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
Reply all
Reply to author
Forward
0 new messages