 ;; This first version of Aspire schema is intended to be installed in
-;; VLACS' customized Moodle DB.
+;; VLACS' customized Moodle DB (postgres).
+;; Our long-term plan is to migrate all our custom data from our
+;; Moodle DB to Datomic, including this.
 
-;; see https://github.com/miner/herbert for schematizing this
+;; Conventions
+;; ---------------------------------
+;; * every table has an .id field that's a :bigserial
+;; * any table that may need to share an ID with a third-party system has an id_sk field for this purpose
+;; * 
 
+;; TODO: see https://github.com/miner/herbert for schematizing this
 ;; TODO: write fns to add _hist tables
 ;; TODO: write fns to output _hist-management triggers
 {:tables

                   :indices {:comp2perf_asmt_id_ux [[:id] :unique]}
                   :foreign-keys {:comp2perf_asmt_c_fk [:comp_id :comp :id]
                                  :comp2perf_asmt_pa_fk [:perf_asmt_id :perf_asmt :id]}}
  :user2comp {:cols [[:id :bigserial]

                     [:sis_user_id :bigint]

                     ;; qualitative
                     [:score_type :varchar]
                     [:qualitative_notes :text]

                     ;; NOTE: no status field here; use our current
                     ;; enrollments table for status for now.

                     [:date_created "TIMESTAMP WITH TIME ZONE" "NOT NULL" "DEFAULT CURRENT_TIMESTAMP"]]

              ;; Note that a user may have more than one relationship
              ;; to a comp, if she started and then decided to hold
              ;; off and take it much later.
              :primary-key [:sis_user_id :comp_id :start_date]
              :indices {:user2comp_id_ux [[:id] :unique]
                        :user2comp_u_ix [[:sis_user_id]]
