Fix date format
Add unique index for external id