Move _id generation to schema