   ;; TODO insert into datomic db
   (let [db (d/db db-conn)
         user-eid (d/q '[:find ?member .
-                        :in $ domain user
+                        :in $ ?domain ?user
                         :where
-                        [?team :team/domain domain]
+                        [?team :team/domain ?domain]
                         [?team :team/members ?member]
                         [?member :member/name ?user]]
                       db domain user)

                 (triggers/with-schedule
                   (cron/schedule
                    (cron/cron-schedule cron-string))))]
    (scheduler/schedule scheduler job trigger)))

(defn init-start-jobs [scheduler db-conn]
  (doseq [db (d/db db-conn)
          {:keys [domain schedule]} (d/q '[:find (pull ?team [:team/domain :team/schedule])
                                           :where
                                           [?team :team/domain]]
                                         db)]
    (schedule-questionnaire-job scheduler
                                db-conn
                                domain
                                schedule)))

(defn schedule-new [schduler db-before db-after]
  (let [new-domains (d/q '[:find [?new-domains ...]

  ;; db stuff

  (def db-uri "datomic:free://localhost:4334/teamweek")
  (-main db-uri)


  (d/delete-database db-uri)
  (d/create-database db-uri)

  (def db-conn (d/connect db-uri))

  (d/q '[:find (pull ?answer [:answer/author :answer/text :answer/ts])
         :where
         [?answer :answer/text]]
       (d/db db-conn))


  (d/transact db-conn (read-string (slurp "../webapp/resources/schema.edn")))

  (future (listen-for-team-updates nil db-conn))


  (defn create-team [domain slack-token schedule-string members questions]
    {:db/id (d/tempid :db.part/user)
     :team/domain domain
     :team/token slack-token
     :team/schedule schedule-string
     :team/members (for [[name email] members]
