'use strict';
module.exports = {
    up: (queryInterface, Sequelize) => {
        return queryInterface.createTable('Goods', {
            id: {
                allowNull: false,
                autoIncrement: true,
                primaryKey: true,
                type: Sequelize.INTEGER
            },
            goodsName: {
              allowNull: false,
              type: Sequelize.STRING
            },
            goodsDescription: {
              allowNull: false,
              type: Sequelize.STRING
            },
            isSale: {
              allowNull: false,
              type: Sequelize.BOOLEAN,
              defaultValue: false
            },
            goodsFullDescription: {
              allowNull: false,
              type: Sequelize.TEXT("long"),
            },
            goodsBrandId: {
              allowNull: false,
              type: Sequelize.INTEGER
            },
            goodsGroupId: {
              allowNull: false,
              type: Sequelize.INTEGER
            },
            goodsGender: {
              allowNull: false,
              type: Sequelize.STRING
            },
            goodsMadeIn: {
              allowNull: false,
              type: Sequelize.STRING
            },
            volumesArray: {
              allowNull: false,
              type: Sequelize.ARRAY(Sequelize.TEXT),
              defaultValue: []
            },
            createdAt: {
                allowNull: false,
                type: Sequelize.DATE,
                defaultValue: Sequelize.NOW
            },
            updatedAt: {
                allowNull: false,
                type: Sequelize.DATE
            }
        });
    },
    down: (queryInterface, Sequelize) => {
        return queryInterface.dropTable('Goods');
    }
};
