Fixed migration problem by putting in condition for tables renaming