You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.4 KiB

'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('Products', {
id: {
type: Sequelize.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
description: {
type: Sequelize.STRING,
allowNull: false,
},
price: {
type: Sequelize.DECIMAL(10, 2),
allowNull: false,
},
imageUrl: {
type: Sequelize.STRING,
allowNull: true,
},
tags: {
type: Sequelize.ARRAY(Sequelize.STRING),
allowNull: true,
},
quantity: {
type: Sequelize.INTEGER,
allowNull: false,
defaultValue: 0,
},
brand: {
type: Sequelize.STRING,
allowNull: true,
},
color: {
type: Sequelize.STRING,
allowNull: true,
},
category: {
type: Sequelize.STRING,
allowNull: false,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Products');
},
};