Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* 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
static copyModel(sequelizeInstance, model) {
class TempModel extends Sequelize.Model {
}
let newModel = TempModel.init(
_.merge({ }, model.rawAttributes),
_.merge({ }, model.options, { 'sequelize': sequelizeInstance, 'modelName': model.name })
);
// Let's recreate a new instance of the datatype
for (let att of _.values(newModel.rawAttributes)) {
att.type = new Sequelize.DataTypes[att.type.key]();
}
return newModel;
}
/* eslint quotes: 0 */
// Defines Sequelize model for service `teams`. (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
},
name: {
type: DataTypes.TEXT,
allowNull: false
},
members: {
module.exports.up = async (query, DataTypes) => {
let testsTable = await query.describeTable('tests');
if (!testsTable.processor_id) {
await query.addColumn(
'tests', 'processor_id',
Sequelize.DataTypes.UUID);
}
};
models.forEach(f => {
if (!f.endsWith(".js") || f === "index.js") return;
try {
const modelName = f.split(".")[0];
modelList[modelName] = require(`./${modelName}`)(
sequelize,
Sequelize.DataTypes
);
} catch (e) {
client.logError(`Unable to load model ${f}: ${e}`);
}
});
export default (sequelize: Sequelize.Sequelize) => {
User.init({
email: { field: "email", type: Sequelize.DataTypes.STRING, unique: { name: "email", msg: "email already exist" }},
phone_number: { field: "phone_number", type: Sequelize.DataTypes.STRING, unique: { name: "phone_number", msg: "phone number already exist" }},
first_name: { field: "first_name", type: Sequelize.DataTypes.STRING },
last_name: { field: "last_name", type: Sequelize.DataTypes.STRING },
password: { field: "password", type: Sequelize.DataTypes.STRING },
gender: { field: "gender", type: Sequelize.DataTypes.STRING },
birth_date: { field: "birth_date", type: Sequelize.DataTypes.DATE },
forgot_password: { field: "forgot_password", type: Sequelize.DataTypes.STRING },
created_at: { field: "created_at", type: Sequelize.DataTypes.DATE },
updated_at: { field: "updated_at", type: Sequelize.DataTypes.DATE },
deleted_at: { field: "deleted_at", type: Sequelize.DataTypes.DATE },
}, {
sequelize,
timestamps: true,
paranoid: true,
underscored: true,
tableName: "users"