import { DEMARCHES_TYPES_IDS } from 'camino-common/src/static/demarchesTypes'
import { TITRES_TYPES_IDS } from 'camino-common/src/static/titresTypes'
import { Knex } from 'knex'

export const up = async (knex: Knex): Promise<void> => {
  await knex.raw(
    `update titres_demarches td set type_id = '${DEMARCHES_TYPES_IDS.ExtensionDePerimetre}' where td.type_id = 'dep' and td.titre_id in (select t.id from titres t where t.type_id ='${TITRES_TYPES_IDS.AUTORISATION_D_EXPLOITATION_METAUX}')`
  )
}

export const down = (): void => {}
