-
Notifications
You must be signed in to change notification settings - Fork 68
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
Loosen column length constraints #152
Conversation
4ed2272
to
b224237
Compare
LGTM, just got a question about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ironically you did this PR just after we started talking about migrating to uuids. Any idea when you’ll merge? |
Hi @jhilde, I was hoping to get this merged this week. |
@scottyp-env: That's exactly it. Back in Rails 3 when we inserted strings too large for the columns, the values would be silently truncated. So we added these checks. Now Rails will raise an error when inserting such a string. So these checks are a nice to have as they'll alert us earlier in the development lifecycle, when defining the accounts and transfers rather than when the systems in operating in production. Actually, now that I think about it the |
There doesn't seem a strong reason for the |
8384c6f
to
888a101
Compare
888a101
to
8333e20
Compare
Resolves #145
Context
The default database schema provided by DoubleEntry had small column length limits. These values were specific to the optimisations made on a specific project at Envato. As this project is open source and in use under vastly different use cases, these constraints limit the project effectiveness at satisfying these use cases.
Change
Remove the column length constraints from the database migration template. DoubleEntry will operate correctly no matter the size of these columns.
Remove the default value for the
scope_identifier_max_length
,account_identifier_max_length
andcode_max_length
configuration values. The checks will not be performed during account and transfer configuration unless these are options are set.MySQL 5.6 schema diff on Rails 5.2 looks like this:
To apply this change a migration similar to the following could be used:
Engineering teams can choose to apply this change, or apply their own column length constraints specific to their needs.