Copyright (C) 2017 The Open Library Foundation
This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.
This contains init_mod_waitlist.py
which can be used to populate mod-waitlist
datatables with sample waitlist reserves
data.
In order for init_mod_waitlist.py
to work properly, the datatables for mod-waitlist
must be generated for the diku
tenant. The datatables can be autogenerated by enabling mod-waitlist
for the diku
tenant through the Okapi gateway.
Datatables for mod-waitlist
are autogenerated when mod-waitlist
is enabled for a given user (e.g. diku
) through the following process:
- An HTTP POST request to enable
mod-waitlist
fordiku
is sent to the Okapi gateway. - The Okapi gateway calls the
/_/tenant
endpoint ofmod-waitlist
. - The
/_/tenant
endpoint uses a template to autogenerate the postgres, tenant-specific schema formod-waitlist
.
Ingesting mod-waitlist sample data involves:
- Running and enabling
mod-waitlist
through Okapi, in order to trigger the creation of thediku_mod_waitlist
schema andcourses
/items
/instructors
tables. - Running
init_mod_waitlist.py
which will automatically add uuidv4 ids to the json objects and then insert them into thejsonb
column of their corresponding postgres datatables.