Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySql set(...) data type support added #529

Merged
merged 0 commits into from Aug 3, 2012
Merged

Conversation

Slike9
Copy link
Contributor

@Slike9 Slike9 commented Aug 3, 2012

In MySql values of "set(...)" data type loose default values.

@jeremyevans
Copy link
Owner

This looks simple enough, but from the MySQL documentation, set is not the same as the enum type, it can have multiple values. A cleaner fix would probably be to override it in the MySQL adapter since it is a MySQL-specific type (and refactor column_schema_to_ruby_default), but if you don't want to do that, just returning :set for the set type and adding :set next to :enum in column_schema_to_ruby_default seems like a better way to handle this.

@Slike9 Slike9 merged commit 8c3ac0e into jeremyevans:master Aug 3, 2012
@jeremyevans
Copy link
Owner

I've decided to fix this and do some refactoring of the related code. I'm currently testing this, it should hopefully be up shortly.

@jeremyevans
Copy link
Owner

Not sure what's going on with GitHub, as Slike9 doesn't have permission to merge into jeremyevans:master, and it doesn't look like the merge was actually applied to the repository.

jeremyevans added a commit that referenced this pull request Aug 3, 2012
While here, refactor column_schema_to_ruby_default to not check
for database types.  Instead, override the method and call
super inside the shared adapters.

Instead of supporting set for all databases, only add it to the
shared mysql adapter.  Likewise, since interval is only supported
on PostgreSQL, move support for it to the shared postgres adapter.

For simplicity, still recognize the :set and :interval type symbols
in the global code in order to return the default values as a ruby
string, though that may be refactored out to the adapters later.

While here, do some minor cleaning up of the postgres adapter specs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants