Fix schema alter and use db_update instead of drupal_write_record