Edited db upgrade script