fix migration with generic keys