Move primary key definition after properties are installed

New versions of gom print a warning if you assign a primary key to a property
that doesn't (yet) exist.