import * as Sequelize from 'sequelize'

async function up (utils: {
  transaction: Sequelize.Transaction
  queryInterface: Sequelize.QueryInterface
  sequelize: Sequelize.Sequelize
}): Promise<void> {
  await utils.sequelize.query(
    `DROP INDEX IF EXISTS "idx_event_registration_userId"`,
    { transaction: utils.transaction }
  )

  await utils.sequelize.query(
    `ALTER TABLE "eventRegistration" DROP COLUMN IF EXISTS "userId"`,
    { transaction: utils.transaction }
  )
}

function down (options) {
  throw new Error('Not implemented.')
}

export {
  up,
  down
}
