'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('items', {
      id: {
        type: Sequelize.BIGINT,
        primaryKey: true,
        autoIncrement: true
      },
      type: {
        type: Sequelize.STRING,
        defaultValue: "shirt",
        default: "shirt",
        allowNull: false
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      name: {
        type: Sequelize.TEXT,
        allowNull: false,
      },
      UserId: {
        type: Sequelize.BIGINT,
      },
      sourceFile: {
        type: Sequelize.TEXT,
      },
      previewFile: {
        type: Sequelize.TEXT
      },
      limited: {
        type: Sequelize.BOOLEAN,
        defaultValue: 0,
        default: 0
      },
      salePrice: {
        type: Sequelize.BIGINT
      },
      saleEnabled: {
        type: Sequelize.BOOLEAN,
        defaultValue: 0,
        default: 0
      },
      price: {
        type: Sequelize.BIGINT
      },
      quantityAllowed: {
        type: Sequelize.BIGINT,
        default: 0,
        defaultValue: 0
      },
      offSale: {
        type: Sequelize.BOOLEAN,
        default: 0,
        defaultValue: 0
      }
    });
    return queryInterface.createTable('inventory', {
      id: {
        type: Sequelize.BIGINT,
        primaryKey: true,
        autoIncrement: true
      },
      UserId: {
        type: Sequelize.BIGINT
      },
      purchasePrice: {
        type: Sequelize.BIGINT
      },
      isReselling: {
        type: Sequelize.BOOLEAN,
        default: 0,
        defaultValue: 0
      },
      isResellingPrice: {
        type: Sequelize.BIGINT
      },
      ItemId: {
        type: Sequelize.BIGINT
      },
      boughtFrom: {
        type: Sequelize.BIGINT
      }
    });
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('inventory');
    return queryInterface.dropTable('items');
  }
};
