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(documentation): use bigint instead of integer #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidalencar
Copy link

Updating the documentation to guide users on creating their complex type using bigint instead of integer.

@davidalencar
Copy link
Author

When we first implemented it, we simply followed the documentation and created our complex type using integer, which corresponds to an int32. However, when financial transactions in our application started to involve larger amounts, we exceeded the capacity of int32. By that point, the complex type money_with_currency was already in use across multiple tables in PostgreSQL and couldn’t be modified. We were forced to create a new type in the database using bigint (int64) and a new type in Elixir, which we named bigmoney. We had to migrate the data from the old fields that used the complex type with integer, and this migration took weeks and a lot of effort.

This simple change I'm proposing will save a lot of work and headaches. =)

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.

1 participant