Move a function from migrate.py to migrate_col.py