public function uniquedata()
    {
        $required = self::config()->required_fields; //TODO: also combine with all ancestors of this->class
        $unique = [];
        $hasOnes = $this->hasOne();
        //reduce record to only required fields
        if ($required) {
            foreach ($required as $field) {
                if ($hasOnes === $field || isset($hasOnes[$field])) {
                    $field = $field . 'ID'; //add ID to hasones
                }
                $unique[$field] = $this->$field;
            }
        }
        return $unique;
    }