-
Notifications
You must be signed in to change notification settings - Fork 183
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
- Adds support for long JSON strings when using embedOne
#132
Conversation
… models. - Converts JSON columns to TEXT for extra length allowance
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
This reverts commit 5e81bce.
embedsOne relation is picked up as `default`, therefore we need to keep the default value for now as TEXT.
@@ -527,7 +527,7 @@ function mixinMigration(PostgreSQL) { | |||
default: | |||
case 'String': | |||
case 'JSON': | |||
return 'VARCHAR' + (colLength ? '(' + colLength + ')' : '(1024)'); | |||
return 'TEXT'; | |||
case 'Text': | |||
return 'VARCHAR' + (colLength ? '(' + colLength + ')' : '(1024)'); |
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.
This should be TEXT too, right?
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.
Yes agree, will update now.
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.
All updated.
…or-postgresql - modifies `Text` loopback type mapping to `text` in postgres
LGTM |
- Adds support for long JSON strings when using `embedOne`
Without this change, we are unable to use postgresql as a datasource for some model relations that use the
embedsOne
. This is because the previous default value for detected JSON data types isVARCHAR(1024)
. Now by default, the column data type will betext
, allowing for long JSON strings to be imported into the database.References issue: #131