text: const RemoveTopicIds = {
  
    databaseName: 'maha',
  
    up: async (knex) => {
      const versions = await knex('maha_versions').where({
        versionable_type: 'automation_workflows',
        key: 'config'
      })
      await Promise.mapSeries(versions, async (version) => {
        await knex('maha_versions').where('id', version.id).update({
          value: {
            ...version.value,
            steps: version.value.steps.map(step => ({
              ...step,
              ...step.action === 'ifthen' ? {
                config: {
                  ...step.config,
                  branches: step.config.branches.map(branch => ({
                    ...branch,
                    criteria: branch.criteria.map(criteria => ({
                      ...criteria,
                      field: criteria.field === 'contact.topic_ids' ? 'contact.list_ids' : criteria.field
                    }))
                  }))
                }
              } : {}
            }))
          }
        })
      })
    },
  
    down: async (knex) => {
    }
  
  }
  
  export default RemoveTopicIds
  