Large set of changes - building the GUI for the data tracking app.
This commit is contained in:
@@ -21,9 +21,22 @@ module.exports = function(sequelize, DataTypes) {
|
||||
//GAAP standard is to use DECIMAL(13,4) for precision when dealing with money. 13 digits before the decimal, and 4 after it.
|
||||
type: DataTypes.DECIMAL(13,4),
|
||||
allowNull: false
|
||||
},
|
||||
createdAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false
|
||||
},
|
||||
updatedAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false
|
||||
},
|
||||
deletedAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true
|
||||
}
|
||||
}, {
|
||||
freezeTableName: true, // Model tableName will be the same as the model name
|
||||
paranoid: true,
|
||||
classMethods: {
|
||||
associate: function(models) {
|
||||
Sale.belongsTo(models.Item, {as: 'item', foreignKey: {name: 'itemId', field: 'itemId'}});
|
||||
|
||||
Reference in New Issue
Block a user