migrations
calculate 'order' field.  fix various issues