def migrate(engine):
    """Replace 'backend' with 'store' in meta_data column of image_locations"""
    sql_query = (
        'UPDATE image_locations SET meta_data = REPLACE(meta_data, \'"backend":\', \'"store":\') where INSTR(meta_data,  \'"backend":\') > 0'
        )
    if engine.name == 'postgresql':
        sql_query = (
            'UPDATE image_locations SET meta_data = REPLACE(meta_data, \'"backend":\', \'"store":\') where POSITION(\'"backend":\' IN meta_data) > 0'
            )
    with engine.connect() as con:
        migrated_rows = con.execute(sql_query)
        return migrated_rows.rowcount
