Files
yourpart3/backend/models/falukant/data/inventory.js

38 lines
782 B
JavaScript

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
class Inventory extends Model { }
Inventory.init({
stockId: {
type: DataTypes.INTEGER,
allowNull: false,
},
productId: {
type: DataTypes.INTEGER,
allowNull: false,
},
quantity: {
type: DataTypes.INTEGER,
allowNull: false,
},
quality: {
type: DataTypes.INTEGER,
allowNull: false,
},
producedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
}
}, {
sequelize,
modelName: 'Inventory',
tableName: 'inventory',
schema: 'falukant_data',
timestamps: false,
underscored: true,
});
export default Inventory;