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

- Adds support for long JSON strings when using embedOne #132

Merged
merged 5 commits into from
Mar 16, 2016

Conversation

sidewaiise
Copy link
Contributor

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 is VARCHAR(1024). Now by default, the column data type will be text, allowing for long JSON strings to be imported into the database.

References issue: #131

… models.

- Converts JSON columns to TEXT for extra length allowance
@slnode
Copy link

slnode commented Mar 16, 2016

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

sidewaiise and others added 3 commits March 16, 2016 14:31
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)');
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
@superkhau
Copy link
Contributor

LGTM

superkhau added a commit that referenced this pull request Mar 16, 2016
- Adds support for long JSON strings when using `embedOne`
@superkhau superkhau merged commit 55efe74 into loopbackio:master Mar 16, 2016
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.

None yet

5 participants