Created
March 3, 2017 20:28
-
-
Save wharley/b42caa37566086a8b71685dae4320f4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(sequelize, DataTypes){ | |
var Rece = sequelize.define('Receita', { | |
id: { | |
type : DataTypes.INTEGER, | |
primaryKey: true, | |
autoIncrement: true, | |
field: 'seq_receita' | |
}, | |
cod_pessoa: { | |
type : DataTypes.INTEGER, | |
field: 'cod_pessoa' | |
}, | |
nome_receita: { | |
type : DataTypes.STRING, | |
field: 'nome_receita' | |
}, | |
seq_tipo_receita: { | |
type : DataTypes.STRING, | |
field: 'seq_tipo_receita' | |
}, | |
data_vencimento: { | |
type: DataTypes.DATE, | |
allowNull: true, | |
field: 'data_vencimento' | |
} | |
}, | |
{ | |
freezeTableName: true, | |
schema: 'public', | |
tableName: 'receita', | |
timestamps: false, | |
classMethods: { | |
associate: function(model) { | |
Rece.belongsTo(model.Pessoa, {foreignKey: 'cod_pessoa'}); | |
} | |
} | |
}); | |
return Rece; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment