We use Guid.ToString() to create primary keys and our primary keys are annotated with [PrimaryKey].
We naively thought [PrimaryKey] followed the database convention that this also meant the primary key is not nullable.
We now know that Realm allows null primary keys where the primary key datatype is nullable. I’ve therefore added the annotation [Required] to our string primary keys but this throws the exception
The following changes cannot be made in additive-only schema mode:- Property ‘Customer.CustomerId’ has been made required
and so on for all our primary keys.
We have quite a number of users running their businesses on our software so we really can’t ignore this or start again.
Is there a workaround for adding [Required] to existing primary keys?