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

Already on GitHub? Sign in to your account

sqlite3 adapter drops :decimal columns precision & scale when migration tries to alter them #3400

Merged
merged 1 commit into from Oct 21, 2011

Conversation

Projects
None yet
2 participants
Contributor

greinacker commented Oct 21, 2011

After this change, decimal column attributes :precision and :scale will be preserved through migrations. Two tests included, specifically:

  1. test that changing a decimal column type keeps the new attributes, and
  2. test that if you already have a decimal column with precision/scale, that changing another column in the same table doesn't wipe out the precision and scale

Both tests fail on master, and pass with this patch.

In fairness, the code to fix this I got from https://gist.github.com/971639 - this was pulled from lighthouse (see issue #625), and I'm not entirely sure who wrote it originally. The tests are new.

Ref issues #3399, #625, #3073

tenderlove added a commit that referenced this pull request Oct 21, 2011

Merge pull request #3400 from greinacker/sqlite-decimal
sqlite3 adapter drops :decimal columns precision & scale when migration tries to alter them

@tenderlove tenderlove merged commit d8b09f3 into rails:master Oct 21, 2011

Contributor

greinacker commented Nov 14, 2011

Is there something I need to do to get this merged into 3.1.2 or 3.1.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment