Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof val === "string") {
val = val.toLowerCase();
} else {
throw new Error("email must be a string");
}
this.setDataValue("email", val);
}
}
}, {
timestamps: false,
indexes: [
{
name: "DefineOptionsIndexesTest_lower_email",
unique: true,
fields: [
Sequelize.fn("LOWER", Sequelize.col("email"))
]
}
]
} );
//
// Transaction
// ~~~~~~~~~~~~~
//
// https://github.com/sequelize/sequelize/blob/v3.4.1/test/integration/transaction.test.js
//
s.transaction().then( function( t ) {
t.commit();
t.rollback();
/* eslint quotes: 0 */
// Defines Sequelize model for service `nedb6`. (Can be re-generated.)
const merge = require('lodash.merge');
const Sequelize = require('sequelize');
// eslint-disable-next-line no-unused-vars
const DataTypes = Sequelize.DataTypes;
// !code: imports // !end
// !code: init // !end
let moduleExports = merge({},
// ! code: sequelize_model
{},
// !end
// !code: moduleExports // !end
);
// !code: exports // !end
module.exports = moduleExports;
// !code: funcs // !end
// !code: end // !end
/* eslint quotes: 0 */
// Defines Sequelize model for service `users1`. (Can be re-generated.)
const merge = require('lodash.merge')
const Sequelize = require('sequelize')
// eslint-disable-next-line no-unused-vars
const DataTypes = Sequelize.DataTypes
// !code: imports // !end
// !code: init // !end
// Your model may need the following fields:
// email: { type: DataTypes.STRING, allowNull: false, unique: true },
// password: { type: DataTypes.STRING, allowNull: false },
// auth0Id: { type: DataTypes.STRING },
// googleId: { type: DataTypes.STRING },
// facebookId: { type: DataTypes.STRING },
// githubId: { type: DataTypes.STRING },
let moduleExports = merge({},
// ! code: sequelize_model
{},
// !end
// !code: moduleExports // !end
)
/* eslint quotes: 0 */
// Defines Sequelize model for service `users1`. (Can be re-generated.)
const merge = require('lodash.merge');
const Sequelize = require('sequelize');
// eslint-disable-next-line no-unused-vars
const DataTypes = Sequelize.DataTypes;
// !code: imports // !end
// !code: init // !end
// Your model may need the following fields:
// email: { type: DataTypes.STRING, allowNull: false, unique: true },
// password: { type: DataTypes.STRING, allowNull: false },
// auth0Id: { type: DataTypes.STRING },
// googleId: { type: DataTypes.STRING },
// facebookId: { type: DataTypes.STRING },
// githubId: { type: DataTypes.STRING },
let moduleExports = merge({},
// ! code: sequelize_model
{},
// !end
// !code: moduleExports // !end
);
/* eslint quotes: 0 */
// Defines Sequelize model for service `nedb4`. (Can be re-generated.)
const merge = require('lodash.merge');
const Sequelize = require('sequelize');
// eslint-disable-next-line no-unused-vars
const DataTypes = Sequelize.DataTypes;
// !code: imports // !end
// !code: init // !end
let moduleExports = merge({},
// ! code: sequelize_model
{
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true
},
nedb2Id: {
type: DataTypes.INTEGER
}
},
// !end
before((done) => {
let adminProfileId = '';
User.findOne({
where: {
name: {
[Op.iLike]: OBAdminUser.name,
},
},
})
.then((OBAdminUser) => adminProfileId = OBAdminUser.profileId)
// create a normal user
.then(() => User.create({
profileId: profileOneId,
name: userZero,
email: userZero,
password: userZero,
}))
// create a normal user
.then(() => User.create({
profileId: profileOneId,
Sequelize.BLOB( 'tiny' );
Sequelize.BLOB( 'medium' );
Sequelize.BLOB( { length : 'medium' } );
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
new Sequelize.VIRTUAL( Sequelize.STRING );
new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
//
// Deferrable
Sequelize.BLOB( 'long' );
Sequelize.ARRAY( Sequelize.STRING );
Sequelize.ARRAY( Sequelize.STRING( 100 ) );
Sequelize.ARRAY( Sequelize.INTEGER );
Sequelize.ARRAY( Sequelize.HSTORE );
Sequelize.ARRAY( Sequelize.ARRAY( Sequelize.STRING ) );
Sequelize.ARRAY( Sequelize.TEXT );
Sequelize.ARRAY( Sequelize.DATE );
Sequelize.ARRAY( Sequelize.BOOLEAN );
Sequelize.ARRAY( Sequelize.DECIMAL );
Sequelize.ARRAY( Sequelize.DECIMAL( 6 ) );
Sequelize.ARRAY( Sequelize.DECIMAL( 6, 4 ) );
Sequelize.ARRAY( Sequelize.DOUBLE );
Sequelize.ARRAY( Sequelize.REAL );
Sequelize.ARRAY( Sequelize.JSON );
Sequelize.ARRAY( Sequelize.JSONB );
Sequelize.GEOMETRY;
Sequelize.GEOMETRY( 'POINT' );
Sequelize.GEOMETRY( 'LINESTRING' );
Sequelize.GEOMETRY( 'POLYGON' );
Sequelize.GEOMETRY( 'POINT', 4326 );
Sequelize.VIRTUAL;
Sequelize.VIRTUAL( Sequelize.STRING );
Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
new Sequelize.VIRTUAL( Sequelize.STRING );
new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']);
//
// Deferrable
// ~~~~~~~~~~~~
//
// https://github.com/sequelize/sequelize/blob/v3.4.1/test/integration/sequelize/deferrable.test.js
//
// DataTypes
// ~~~~~~~~~~~
//
// https://github.com/sequelize/sequelize/blob/v3.4.1/test/unit/sql/data-types.test.js
//
Sequelize.STRING;
Sequelize.STRING( 1234 );
Sequelize.STRING( { length : 1234 } );
Sequelize.STRING( 1234 ).BINARY;
Sequelize.STRING.BINARY;
Sequelize.TEXT;
Sequelize.TEXT( 'tiny' );
Sequelize.TEXT( { length : 'tiny' } );
Sequelize.TEXT( 'medium' );
Sequelize.TEXT( 'long' );
Sequelize.CHAR;
Sequelize.CHAR( 12 );
Sequelize.CHAR( { length : 12 } );
Sequelize.CHAR( 12 ).BINARY;
Sequelize.CHAR.BINARY;
Sequelize.BOOLEAN;
Sequelize.DATE;
Sequelize.DATE(6);
Sequelize.UUID;
Sequelize.UUIDV1;
Sequelize.UUIDV4;
Sequelize.NOW;
Sequelize.INTEGER;
Sequelize.INTEGER.UNSIGNED;
// DataTypes
// ~~~~~~~~~~~
//
// https://github.com/sequelize/sequelize/blob/v3.4.1/test/unit/sql/data-types.test.js
//
Sequelize.STRING;
Sequelize.STRING( 1234 );
Sequelize.STRING( { length : 1234 } );
Sequelize.STRING( 1234 ).BINARY;
Sequelize.STRING.BINARY;
Sequelize.TEXT;
Sequelize.TEXT( 'tiny' );
Sequelize.TEXT( { length : 'tiny' } );
Sequelize.TEXT( 'medium' );
Sequelize.TEXT( 'long' );
Sequelize.CHAR;
Sequelize.CHAR( 12 );
Sequelize.CHAR( { length : 12 } );
Sequelize.CHAR( 12 ).BINARY;
Sequelize.CHAR.BINARY;
Sequelize.BOOLEAN;
Sequelize.DATE;
Sequelize.DATE(6);
Sequelize.UUID;
Sequelize.UUIDV1;
Sequelize.UUIDV4;
Sequelize.NOW;
Sequelize.INTEGER;
Sequelize.INTEGER.UNSIGNED;
Sequelize.INTEGER.UNSIGNED.ZEROFILL;
Sequelize.INTEGER( 11 );