Update database code