Work in progress: automated database upgrade script