Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

replace nullable sql field params #566

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/udaru-core/lib/ops/organizationOps.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function buildOrganizationOps (db, config) {
id, name, description, metadata
)
VALUES (
${id}, ${name}, ${description}, ${metadata}
${id}, ${name}, ${description}, ${metadata || null}
mcollina marked this conversation as resolved.
Show resolved Hide resolved
)
RETURNING id
`
Expand Down Expand Up @@ -415,7 +415,7 @@ function buildOrganizationOps (db, config) {
SET
name = ${name},
description = ${description},
metadata = ${metadata}
metadata = ${metadata || null}
WHERE id = ${id}
`
db.query(sqlQuery, function (err, result) {
Expand Down
4 changes: 2 additions & 2 deletions packages/udaru-core/lib/ops/teamOps.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function buildTeamOps (db, config) {
${teamId.toString()},
${job.params.name},
${job.params.description},
${job.params.metadata},
${job.params.parentId},
${job.params.metadata || null},
${job.params.parentId || null},
${job.params.organizationId},
`
if (job.params.parentId) {
Expand Down
4 changes: 2 additions & 2 deletions packages/udaru-core/lib/ops/userOps.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function buildUserOps (db, config) {
const sqlQuery = SQL`
UPDATE users
SET name = ${name},
metadata = ${metadata}
metadata = ${metadata || null}
WHERE id = ${id}
AND org_id = ${organizationId}
`
Expand Down Expand Up @@ -607,7 +607,7 @@ function buildUserOps (db, config) {
INSERT INTO users (
id, name, org_id, metadata
) VALUES (
${id}, ${name}, ${organizationId}, ${metadata}
${id}, ${name}, ${organizationId}, ${metadata || null}
)
RETURNING id
`
Expand Down