Fix notice introduce in previous commit

Plus simplified the logic around "generated" primary key fields — no longer depends on index="pk" being set on the schema