Post import fixups - WormBase/db-prototypes GitHub Wiki

Once you've imported the data, you may want to transact various small "fixups". These mostly exist to support the curation interface, and might change or be rationalized in the future.

When commands include a butlast form, this is because some of the fixups include time-stamps, but we're going to ignore them since we usually apply these fixups after the main import

 ;; the schema for user accounts
 (use 'web.users)
 ;; schema for extra curation support i.e. ID generators for the 
 ;; Nameserver replacement
 (use 'wb.curation-schema)
 ;; TD says this line can be deleted as it has already been done!
 (use 'pseudoace.wormbase-schema-fixups)

 ;; running the above
 @(d/transact con users-schema) 
 ;; schema for the ID generators for Feature and Gene and Variation classes
 ;; NB has the last used ID numbers hard coded in them
 @(d/transact con (butlast curation-schema))
 ;; the ID generators themselves
 @(d/transact con (butlast curation-init))
 ;; function for making an ID atomically within the database
 @(d/transact con (butlast curation-fns))
 ;; TD says this line can be deleted as it has already been done!
 @(d/transact con (butlast schema-fixups))

If you have some seed users data, you can apply this using something like:

 (def users-data (read-string (slurp "users.edn")))
 @(d/transact con users-data)