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

Fix defaults when dumping ruby schema #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix defaults when dumping ruby schema #27

wants to merge 3 commits into from

Conversation

bsedat
Copy link

@bsedat bsedat commented Feb 28, 2013

I noticed an issue where the schema dump contained the string version of the column default (ie "{foo,bar}"), causing errors when the schema was loaded.

I did some digging and saw that type_cast gets called to extract the default value when dumping the schema and I added a method chain to detect array columns and properly extract them.

@lsimoneau
Copy link
Contributor

+1 this

@derekkraan
Copy link

It would be great if this got merged.

We have an array field in our database with default: [], which gets garbled if we dump the schema (default: "{}"). This pull request fixes that for us.

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.

3 participants