add function to rebuild databases on rails