fixed migration: now using latest planitemid to generate proposalid