synt_backend
Version:
Synt light-weight node backend service
50 lines (49 loc) • 1.16 kB
JavaScript
"use strict";
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable("PurchaseAllocations", {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER,
},
PurchaseEntryId: {
type: Sequelize.INTEGER,
references: {
model: "PurchaseEntries",
key: "id",
},
allowNull: false,
defaultValue: Sequelize.UUIDV4,
onUpdate: "CASCADE",
onDelete: "CASCADE",
},
LotId: {
type: Sequelize.INTEGER,
references: {
model: "Lots",
key: "id",
},
allowNull: false,
defaultValue: Sequelize.UUIDV4,
onUpdate: "CASCADE",
onDelete: "CASCADE",
},
amount: {
type: Sequelize.DECIMAL(8, 2),
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
},
});
},
down: async (queryInterface) => {
await queryInterface.dropTable("PurchaseAllocations");
},
};