sequelize
Advanced tools
Comparing version 6.33.0 to 6.34.0
@@ -26,4 +26,6 @@ "use strict"; | ||
IGNORE: " IGNORE", | ||
lock: false, | ||
forShare: " IN SHARE MODE", | ||
lock: true, | ||
lockOuterJoinFailure: true, | ||
forShare: "FOR UPDATE", | ||
skipLocked: true, | ||
index: { | ||
@@ -30,0 +32,0 @@ collate: false, |
@@ -320,2 +320,8 @@ "use strict"; | ||
options = options || {}; | ||
if (options.onUpdate) { | ||
delete options.onUpdate; | ||
} | ||
if (options.onDelete && options.onDelete.toUpperCase() === "NO ACTION") { | ||
delete options.onDelete; | ||
} | ||
const constraintSnippet = this.getConstraintSnippet(tableName, options); | ||
@@ -614,6 +620,16 @@ tableName = this.quoteTable(tableName); | ||
let template; | ||
template = attribute.type.toSql ? attribute.type.toSql() : ""; | ||
if (attribute.type instanceof DataTypes.JSON) { | ||
template += ` CHECK (${this.quoteIdentifier(options.attributeName)} IS JSON)`; | ||
return template; | ||
} | ||
if (Utils.defaultValueSchemable(attribute.defaultValue)) { | ||
template += ` DEFAULT ${this.escape(attribute.defaultValue)}`; | ||
} | ||
if (attribute.allowNull === false) { | ||
template += " NOT NULL"; | ||
} | ||
if (attribute.type instanceof DataTypes.ENUM) { | ||
if (attribute.type.values && !attribute.values) | ||
attribute.values = attribute.type.values; | ||
template = attribute.type.toSql(); | ||
template += ` CHECK (${this.quoteIdentifier(options.attributeName)} IN(${_.map(attribute.values, (value) => { | ||
@@ -624,9 +640,3 @@ return this.escape(value); | ||
} | ||
if (attribute.type instanceof DataTypes.JSON) { | ||
template = attribute.type.toSql(); | ||
template += ` CHECK (${this.quoteIdentifier(options.attributeName)} IS JSON)`; | ||
return template; | ||
} | ||
if (attribute.type instanceof DataTypes.BOOLEAN) { | ||
template = attribute.type.toSql(); | ||
template += ` CHECK (${this.quoteIdentifier(options.attributeName)} IN('1', '0'))`; | ||
@@ -633,0 +643,0 @@ return template; |
{ | ||
"name": "sequelize", | ||
"description": "Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.", | ||
"version": "6.33.0", | ||
"version": "6.34.0", | ||
"funding": [ | ||
@@ -6,0 +6,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2898958
32900