Updated migration to check if a table exists