@knorm/postgres
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,8 @@ | ||
## [2.0.1](https://github.com/knorm/postgres/compare/v2.0.0...v2.0.1) (2019-02-19) | ||
### Bug Fixes | ||
* enable updating `uuid` and `uuid4` type fields ([5bb9b98](https://github.com/knorm/postgres/commit/5bb9b98)) | ||
# [2.0.0](https://github.com/knorm/postgres/compare/v1.3.4...v2.0.0) (2019-02-03) | ||
@@ -2,0 +9,0 @@ |
@@ -134,2 +134,7 @@ const { Knorm } = require('@knorm/knorm'); | ||
case 'uuid': | ||
case 'uuid4': | ||
type = 'uuid'; | ||
break; | ||
// not necessary to type these | ||
@@ -139,4 +144,2 @@ // case 'string': | ||
// case 'email': | ||
// case 'uuid': | ||
// case 'uuid4': | ||
// type = 'text'; | ||
@@ -143,0 +146,0 @@ // break; |
{ | ||
"name": "@knorm/postgres", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Postgres plugin for knorm", | ||
@@ -18,7 +18,7 @@ "main": "index.js", | ||
"@knorm/knorm": "^2.0.0", | ||
"@knorm/relations": "^1.2.3" | ||
"@knorm/relations": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@knorm/knorm": "2.0.0", | ||
"@knorm/relations": "github:knorm/relations#v2", | ||
"@knorm/relations": "2.0.0", | ||
"@semantic-release/changelog": "3.0.2", | ||
@@ -25,0 +25,0 @@ "@semantic-release/git": "7.0.8", |
@@ -996,2 +996,39 @@ const knorm = require('@knorm/knorm'); | ||
}); | ||
it('allows updating `uuid` and `uuid4` fields', async () => { | ||
await createTable(table => { | ||
table.uuid('uuid'); | ||
table.uuid('uuid4'); | ||
}); | ||
class Foo extends Model {} | ||
Foo.table = 'foo'; | ||
Foo.fields = { uuid: 'uuid', uuid4: 'uuid4' }; | ||
await new Query(Foo).insert({ | ||
id: 1, | ||
uuid: '44bbd080-3453-11e9-8f01-0f3f09e1cf60', | ||
uuid4: 'bb726591-e5ee-4725-b8b2-92101a387a56' | ||
}); | ||
await expect( | ||
new Query(Foo).update({ | ||
id: 1, | ||
uuid: 'a4af1ba0-3453-11e9-8f01-0f3f09e1cf60', | ||
uuid4: '1c5e91d3-07b7-47cc-980a-cef937c66bef' | ||
}), | ||
'to be fulfilled with value satisfying', | ||
[ | ||
{ | ||
id: 1, | ||
uuid: 'a4af1ba0-3453-11e9-8f01-0f3f09e1cf60', | ||
uuid4: '1c5e91d3-07b7-47cc-980a-cef937c66bef' | ||
} | ||
] | ||
); | ||
await expect( | ||
new Query(Foo).update({ id: 1, uuid: null, uuid4: null }), | ||
'to be fulfilled with value satisfying', | ||
[{ id: 1, uuid: null, uuid4: null }] | ||
); | ||
}); | ||
}); | ||
@@ -998,0 +1035,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75808
1909