我在 NodeJS 上有这个模块:
const { cloneDeep, mapValues } = require('lodash');
module.exports = function(Sequelize) {
return new ( function(Sequelize) {
/* Preserve this pointer into forEach callbacks scope */
var self = this;
this.types = {
'string' : Sequelize.STRING,
'text' : Sequelize.TEXT,
'integer' : Sequelize.INTEGER,
'int' : Sequelize.INTEGER,
'decimal' : Sequelize.DECIMAL,
'date' : Sequelize.DATE,
'boolean' : Sequelize.BOOLEAN,
};
/* Convert the Agence model Syntax to Sequelize syntax */
this.parse = function(model) {
/* Convert model Agence attributes to Sequelize types attribs …Run Code Online (Sandbox Code Playgroud)