   {(s/optional-key :collections) {s/Keyword
                                   (s/pred #{:list :set :map})}})
 
+(s/defschema EntityKeySchema
+  {(s/optional-key :has-entity-key?) s/Bool})
+
 ;; unique-key tables are lookup tables with a unique
 ;; constraint on the key, enforced with an LWT
 (s/defschema UniqueKeyTableSchema
-  (merge PrimaryTableSchema
-         CollectionKeysSchema))
+  (merge TableSchema
+         CollectionKeysSchema
+         EntityKeySchema))
 
 ;; secondary tables contain all columns from the primary
 ;; table, with a different primary key.
 ;; secondary and lookup tables may be materialized views,
 ;; which will be used for query but won't be upserted to
 (s/defschema SecondaryTableSchema
-  (merge PrimaryTableSchema
+  (merge TableSchema
+         EntityKeySchema
          {(s/optional-key :view?) s/Bool}))
 
 ;; lookup tables contain columns from the uberkey and
-;; a lookup key
+;; a lookup key, plus any additional with-columns
 (s/defschema LookupTableSchema
   (merge SecondaryTableSchema
          CollectionKeysSchema

   [cats.labs.manifold :refer [deferred-context]]
   [schema.core :as s]
   [clj-time.core :as t]
   [er-cassandra.key :as k]))

(s/defschema CallbackFnSchema

  {(s/optional-key :after-load) [CallbackFnSchema]
   (s/optional-key :before-save) [CallbackFnSchema]})

;; a primary key for a cassandra table
;; the first entry may itself be a vector, representing
;; a compound partition key
(s/defschema KeySchema
