update column defaults in migration and optimize code (minor)