update_attributes not working in self.up migration

You need to call

   Book.reset_column_information

There's an example of this in the API docs for ActiveRecord::Migration. Look for "Using a model after changing its table"