waterline-schema
Advanced tools
Comparing version 1.0.0-18 to 1.0.0-19
@@ -250,2 +250,7 @@ // ██████╗ ██╗ ██╗██╗██╗ ██████╗ | ||
if (_.has(attribute, 'allowNull') && attribute.allowNull === true) { | ||
// Check the attribute isn't an association | ||
if (_.has(attribute, 'model') || _.has(attribute, 'collection')) { | ||
throw new Error('The attribute `' + attributeName + '` on the `' + collection.identity + '` model contains invalid properties. The `allowNull` flag may not be used on attributes that represent associations. For singular associations `null` is allowed by default.'); | ||
} | ||
// Check type isn't a ref or json type | ||
@@ -256,7 +261,2 @@ if (attribute.type.toLowerCase() === 'json' || attribute.type.toLowerCase() === 'ref') { | ||
// Check the attribute isn't an association | ||
if (_.has(attribute, 'model') || _.has(attribute, 'collection')) { | ||
throw new Error('The attribute `' + attributeName + '` on the `' + collection.identity + '` model contains invalid properties. The `allowNull` flag may not be used on attributes that represent associations. For singular associations `null` is allowed by default.'); | ||
} | ||
// Check the attribute isn't a primaryKey | ||
@@ -263,0 +263,0 @@ if (collection.primaryKey === attributeName) { |
{ | ||
"name": "waterline-schema", | ||
"description": "The core schema builder used in the Waterline ORM.", | ||
"version": "1.0.0-18", | ||
"version": "1.0.0-19", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "@sailshq/lodash": "^3.10.2", |