Store_UI/admin/distz/api/migrations/20220209113718-create-order.js

68 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-09-26 06:18:12 +00:00
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('orders', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
date: {
type: Sequelize.DATE
},
userId: {
type: Sequelize.INTEGER
},
storeId: {
type: Sequelize.INTEGER
},
prescriptionId: {
type: Sequelize.INTEGER
},
deviceId:
{
allowNull: false,
type:Sequelize.STRING
},
quantity:{
type: Sequelize.INTEGER
},
amount: {
type: Sequelize.DOUBLE
},
discount: {
type: Sequelize.DOUBLE
},
total: {
type: Sequelize.DOUBLE
},
paymentMethod:{
type : Sequelize.INTEGER},// 1 -pod, 2-upi
orderProcessId: {
type: Sequelize.INTEGER
},
status: {
type: Sequelize.INTEGER
},
createdBy: {
type: Sequelize.INTEGER
},
updatedBy: {
type: Sequelize.INTEGER
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('orders');
}
};