Skip to content

Doesn't work with add_column/change_column (Rails 4.2.0, mysql2) #56

@kevin-at-reflexion

Description

@kevin-at-reflexion

The add_column call doesn't work starting with Rails 4.2.0.
I am using the mysql2 adapter -- I've not test the issue with other adapters, and using the master branch after the merge of pull request #52 (4.2 support).

The resulting MySQL expression for add_column :table_name, :column_name, :uuid is:

ALTER TABLE `table_name` ADD `column_name` uuid

Similarily, for a change_column

ALTER TABLE `table_name` CHANGE `column_name` `column_name` uuid

This naturally results in a Mysql2::Error: You have an error in your SQL syntax near 'uuid'.

I went hunting through ActiveRecord for the appropriate change, but couldn't find the right place, apologies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions