
dm-migrations outputs incorrect CREATE TABLE SQL for MySQL
Reported by Greg Campbell | April 2nd, 2009 @ 06:39 PM | in 0.10.0
This one's my fault, so I'll submit a patch for it as well. dm-migrations currently outputs the table options (ENGINE, COLLATE, CHARACTER SET) before the columns, when they should show up after. This causes a MySQL error.
This also points out the need to have a true dm-migrations integration spec that actually runs migrations against a database for all supported adapters; we don't appear to have one at the moment, and it would have caught this problem immediately. I must have been running my ad-hoc integration test against an incorrect version of the gem.
Comments and changes to this ticket
-
Greg Campbell April 3rd, 2009 @ 11:04 AM
I've pushed a fix for this to http://github.com/gcampbell/dm-m... and sent a pull request to Rando.
-
Greg Campbell May 4th, 2009 @ 05:16 PM
It doesn't look like this fix has made it into dm-more/master yet, and my patch is now out-of-date. Would it be helpful for me to update it and send another pull request?
-
Greg Campbell June 23rd, 2009 @ 04:23 PM
This is still broken as of 0.10 RC1. I'll put together a new patch for the next branch.
-
Martin Gamsjaeger (snusnu) July 9th, 2009 @ 05:12 PM
- Milestone set to 0.10.0
#876 duplicated this ticket and also has an attached patch. I haven't yet tested if the patch applies to 0.10 mainly because i never used dm-migrations so far.
-
Martin Gamsjaeger (snusnu) July 11th, 2009 @ 11:34 AM
- Assigned user changed from Paul Sadauskas (Rando) to Martin Gamsjaeger (snusnu)
- State changed from unconfirmed to accepted
I adapted the original patch to work with current next branch as of today and pushed it to my fork at http://github.com/snusnu/dm-more/commit/8cc9e7b586736cbe0aebd403584...
The reason why it didn't apply cleanly was mainly just line numbers that changed and how 0.10 changed table and column name quoting. All specs for dm-migrations pass.
-
Dan Kubb (dkubb) July 11th, 2009 @ 03:08 PM
- State changed from accepted to resolved
(from [8cc9e7b586736cbe0aebd4035842a3cd94c9bc58]) [dm-migrations] Fixes CREATE TABLE for MySQL.
The CREATE TABLE statement was being output with the table options
before the column list; this was incorrect and caused a MySQL error. As
mentioned in the Lighthouse ticket, it would be a good idea to add true
integration tests (which actually run migrations against a database) for
all supported adapters.Credits go to Greg Campbell for the meat of this patch
[#827 state:resolved] http://github.com/datamapper/dm-more/commit/8cc9e7b586736cbe0aebd40...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
-
876 dm-migrations MySQL CREATE TABLE syntax is wrong This seems to be a duplicate of #827 . I linked to this t...
-
876 dm-migrations MySQL CREATE TABLE syntax is wrong This seems to be a duplicate of #827 . I linked to this t...
-
827 dm-migrations outputs incorrect CREATE TABLE SQL for MySQL [#827 state:resolved] http://github.com/datamapper/dm-mo...