module.exports = {
  up(queryInterface, Sequelize) {
    return queryInterface.createTable('user_payment_methods', {
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      userId: {
        type: Sequelize.INTEGER,
        required: true
      },
      updatedAt: Sequelize.DATE,
      createdAt: Sequelize.DATE,
      ccType: {
        type: Sequelize.STRING(191),
        default: "Unknown",
        unique: false,
      },
      paymentMethod: {
        type: Sequelize.STRING(191),
        default: "PayPal",
        unique: false,
      },
      paymentMethodHash: {
        type: Sequelize.STRING(191),
        default: false,
        unique: false,
      },
      ccHash: {
        type: Sequelize.STRING(191),
        default: false,
        unique: false,
      },
      PaymentToken: {
        type: Sequelize.STRING(191),
        default: false,
        unique: false,
      }
    })
    return queryInterface.createTable('user_subscriptions', {
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      userId: {
        type: Sequelize.INTEGER,
        required: true
      },
      updatedAt: Sequelize.DATE,
      createdAt: Sequelize.DATE,
      premium: {
        type: Sequelize.STRING(191),
        default: "Free",
        unique: false,
      },
      premiumType: {
        type: Sequelize.INTEGER,
        default: false,
        unique: false,
      },
      cancelledAt: {
        type: Sequelize.DATE,
        default: NULL,
        unique: false,
      },
      subscriptionStart: {
        type: Sequelize.DATE,
        default: NULL,
        unique: false,
      },
      subscriptionEnd: {
        type: Sequelize.DATE,
        default: NULL,
        unique: false,
      },
      paymentMethodID: {
        type: Sequelize.INTEGER,
        default: NULL,
        unique: false,
      }
    })
  }
}
