anchor.diff:     (completedp :col-type boolean :col-default nil))
     (:keys id))
   
  +;;;
  +;;; Modifier removal events
  +;;;
   (defdao ev-remove-modifier ()
     ((id :col-type serial :reader id)
      (modifier-id :col-type bigint :initarg :modifier-id))
  
positive.code:                     :where (:and (:= 'entity-id (entity-id entity))
                                   (:= 'package (package-name (symbol-package name)))
                                   (:= 'name (symbol-name name)))))))
  
  (defun create-entity (&key comment)
    (id (with-db () (make-dao 'entity :comment (or comment :null)))))
  
  (defun entity-oid (entity)
    (with-db () (modifier-value entity 'oid)))
  
  (defun (setf entity-oid) (new-value entity)
    (with-db ()
      (with-transaction ()
        (cond ((entity-oid entity)
               (setf (modifier-value entity 'oid 'text-value) new-value))
              ((find-entity-by-oid new-value)
               (error "~S must be a globally unique identifier, but it already identifies entity ~A."
                      new-value (find-entity-by-oid new-value)))
              (t
               (add-modifier entity 'oid new-value
                             :description "Unique external identifier for entity."))))))
  
  (defun find-by-modifier-value (modifier-name value &key (test :=) (allp nil))
    (with-db ()
  
negative.code:     (bt:destroy-thread *entity-system-thread*))
    (setf *entity-system-thread* nil))
  
  ;;;
  ;;; Entity
  ;;;
  (defdao entity ()
    ((id :col-type serial :reader id)
     (comment :col-type (or db-null text)))
    (:keys id))
  
  (defun entity-id (entity)
    ;; Just numbers for now.
    entity)
  
  (defun create-entity (&key comment)
    (id (with-db () (make-dao 'entity :comment (or comment :null)))))
  
  ;;;
  ;;; Modifiers
  ;;;
  (defdao modifier ()
    ((id :col-type serial :reader id)
     (entity-id :col-type bigint :initarg :entity-id)
  