AMY Database structure¶
The primary tables used in AMY (that will appear in most queries) are those that store information on events, persons, memberships, organizations, and instructor training. Additional tables provide more information about events, persons, memberships, and organizations. This information can be useful in writing SQL queries in redash.
Primary Tables in AMY¶
Events¶
workshops_event - Primary table for all event data.
Commonly used fields¶
idSequential, automatically assigned integerstartandendEvent start and end datesslugEvent's unique identifier in the form YYYY-MM-DD-sitenameurlEvent's website. Typically in the format username.github.io/YYYY-MM-DD-sitename (but not required)host_idAn integer representing the Event Host. This is linked to theworkshops_organizationtable- Location based fields:
venueThe venue name of the eventaddressThe street address of the eventlatitudeandlongitudeStored as floating point (decimal) numberscountryStored as the two character country codecontactA list of email addresses listed as contacts for that workshopcompletedA Boolean field to note that all work (including workshop coordination and data entry) is complete.assigned_to_idThe id of the Regional Coordinator or other Carpentries Core Team member assigned to this event. This is linked to theworkshops_persontable.language_idThe integer id of the language used at the workshop. This is not typically recorded. This is linked to theworkshops_languagetableopen_TTT_applicationsUsed only for instructor training eventsadminstrator_idAn integer representing the event organizer. This is linked to theworkshops_organizationtable. Historically any organization could be listed as an administrator. Recent updates to AMY limit this to Data Carpentry, Library Carpentry, Software Carpentry, Instructor Training, Collaborative Lesson Development Training, or self-organized. This enforcement is at the AMY app level, not at the database level.reg_keyEventbrite registration keyinstructors_preLink to both pre- and post-workshop survey results.
Unused fields¶
manual_attendanceWe are no longer collecting or recording attendanceadmin_fee,invoice_statusWe are not recording financial data in AMYrepository_last_commit_hash,repository_metadata,metadata_all_changes,metadata_changedPreviously used to store metadata changesinstructors_postlearners_longtermlearners_postlearners_prePreviously used to store links to surveys.
Persons¶
workshops_person - Primary table for all person data. This includes all individuals, regardless of their role with The Carpentries.
Commonly used fields¶
idSequential, automatically assigned integerpersonalmiddlefamilyThree fields to hold the individual's name. Onlypersonalis required.emailIndividual's primary email address. Used for user log insecondary_emailAlternate email address. Optional.genderOptions arePrefer not to say (undisclosed)FemaleGender variant / non-conformingMaleOther.gender_otherText if individual selectedOthermay_contactA boolean field. We may not contact people if this field is false. This field has been replaced by new-style consents (see also 2021 Consents Project).githubIndividual's GitHub user idtwitterIndividual's Twitter user idblueskyIndividual's Bluesky user idmastodonIndividual's Mastodon urlorcidIndividual's ORCID iDurlLink to the individual's personal websiteairport_idAn integer representing the person's self identified nearest. This is linked to theworkshops_airporttableaffiliationA free text field representing the person's self identified institutional affliation. This is not linked to theworkshops_organizationtable.occupationA free text field representing the person's self identified occupationuser_notesFree text field with notes from the individualpublish_profileA boolean field that acknowledges permission to publish the individual's profile on our website pages such as the Instructors, Trainers, or Maintainers pages. This field has been replaced by new-style consents.countrySelf identified country of residence. Stored as the [two character country code]lesson_publication_consentAllows individual to consent to publishing their name associated with lesson contributions. Individual can select publication by name, ORCID iD, or GitHub id, or not consent to publishing their name or identity. This field has been replaced by new-style consents.
Less commonly used fields¶
last_loginWhen the user last logged in (regardless of their activity or permissions)is_superuserBoolean field to note whether the person is a superuser, giving them all administrative privilegescreated_atAutogenerated timestamp when the record is createdlast_updated_atAutogenerated timestamp when the record was last updatedduplication_reviewed_onTimestamp tracking when a potential duplicate individual's record was reviewedis_activeA boolean field. Only active users are able to log in to AMYdata_privacy_agreementAcknowledges user has read our data policy. Required the first time any user logs in
Other fields¶
passwordNot stored as plain text. Do not use or modify this field for anything.
Memberships¶
workshops_membership - Stores information about each membership agreement.
idSequential, automatically assigned integer.variantMembership type (Gold, Silver, etc.)agreement_startandagreement_endMembership term start and end datesextendedInteger; number of days the membership term end date has been extended by;NULLvalue indicates no extensioncontribution_typeFinancial, Person-days, or Otherworkshops_without_admin_fee_per_agreementInteger; number of centrally organized workshops allowedworkshops_without_admin_fee_rolled_from_previousInteger; number of centrally-organised workshops allowed that was rolled over from previous membership. This should be the same asworkshops_without_admin_fee_rolled_overin preceding membershipworkshops_without_admin_fee_rolled_overInteger; number of centrally-organised workshops allowed that was rolled over to succeeding membership. The same number should be recorded inworkshops_without_admin_fee_rolled_from_previousin succeeding membershippublic_instructor_training_seatsInteger; number of public seats allowed in instructor training events in the original contract.additional_public_instructor_training_seatsInteger; number of additional public seats allowed in instructor training events beyond the original contract.public_instructor_training_seats_rolled_from_previousInteger; number of public instructor training seats allowed that was rolled over from previous membership. This should be the same aspublic_instructor_training_seats_rolled_overin preceding membershippublic_instructor_training_seats_rolled_overInteger; number of public instructor training seats allowed that was rolled over to succeeding membership. The same number should be recorded inpublic_instructor_training_seats_rolled_from_previousin succeeding membershipinhouse_instructor_training_seatsInteger; number of in-house seats allowed in instructor training events in the original contract.additional_inhouse_instructor_training_seatsInteger; number of additional in-house seats allowed in instructor training events beyond the original contract.inhouse_instructor_training_seats_rolled_from_previousInteger; number of in-house instructor training seats allowed that was rolled over from previous membership. This should be the same asinhouse_instructor_training_seats_rolled_overin preceding membershipinhouse_instructor_training_seats_rolled_overInteger; number of in-house instructor training seats allowed that was rolled over to succeeding membership. The same number should be recorded ininhouse_instructor_training_seats_rolled_from_previousin succeeding membershipagreement_linkA link to the Member agreement in Google Driveregistration_codeA string representing the code used by the Member site for Eventbrite registration and the instructor training applicationpublic_statusa string indicating agreement to publicising membership on The Carpentries websitesemergency_contacttext with emergency contact data for the membershipconsortiuma boolean value indicating consortium (umbrella for more than one organisation member)
Member¶
workshops_member - Stores information about organisations and their roles in memberships.
idSequential, automatically assigned integer.membership_id- Integer linking membership instanceorganization_id- Integer linking organisation instancerole_id- Integer linking member role instance
MemberRole¶
workshops_memberrole - Stores roles for organisations in memberships.
idSequential, automatically assigned integer.namestring with role's name, e.g.contact_signatory- preferably a computer-friendly formatverbose_namestring with role's name suitable for humans, e.g.Contact Signatory
MembershipTask¶
fiscal_membershiptask - Stores information about persons and their roles in memberships.
idSequential, automatically assigned integer.membership_id- Integer linking membership instanceperson_id- Integer linking person instancerole_id- Integer linking membership person role instance
MembershipPersonRole¶
fiscal_membershippersonrole - Stores roles for persons in memberships.
idSequential, automatically assigned integer.namestring with role's name - preferably a computer-friendly formatverbose_namestring with role's name suitable for humans
Organizations¶
workshops_organization - Stores all organizations in AMY.
idSequential, automatically assigned integer. This is used by thehost_idandadministrator_idfields in theworkshops_eventtable, and theorganization_idfield in theworkshops_membershiptable.domainWebsite of the organizationfullnameHuman friendly name of the organizationcountryStored as the [two character country code]latitudeandlongitudeStored as floating point (decimal) numbersaffiliated_organizationsMany-to-many relationship between organizations; the purpose of this field is to "link together" organisations that in some way are related. For example, "University of California" organisation can be linked to "University of California, Berkeley", "University of California, Davis", and "University of California, Los Angeles". This field is not being used.
Training applications¶
workshops_trainingrequest - Primary table for all Instructor Training applications
personal,middle,familyThree fields to hold the individual's name.person_idThis is linked to theworkshops_persontable after the trainee is matched to a PersonstateState of the individual's application. Options area(accepted),p(pending),w(withdrawn),d(discarded)emailIndividual's primary email address. Used for user log insecondary_emailAlternate email address. Optional.affiliationA free text field representing the person's self identified institutional affliation. This is not linked to theworkshops_organizationtable.countryStored as the [two character country code]locationFree text field to share location within country (city, province, state, etc.)underresourcedBoolean field whether individual is from an underresourced areaunderrepresentedBoolean field whether individual is from an underrepresented demographicunderrepresented_detailsDetails on the individual's underrepresented status
githubIndividual's GitHub user idreview_processWhether this is an open or pre-approved (usually member) Training applicationgroup_nameRegistration code used for pre-approved requestsscore_autoAutomatically generated score from application reviewscore_manualManually adjusted score from application reviewscore_notesNotes about the individual's scoreworkshop_teaching_agreementAgreement that applicant agrees to teach a Carpentries workshopmax_travelling_frequencyFrequency individual may travel to teach. Select one of given options.teaching_frequency_expectationFrequency individual may teach. Select one of given options.occupationApplicant's current occupation/career stage. Select one of given options.occupation_otherText if individual selectedOther
previous_trainingLevel of previous training as a teacher/instructor. Select one of given options.previous_training_otherText if individual selectedOther
programming_language_usage_frequencyFrequency in using programming languages. Select one of given options.previous_experienceApplicant's previous experience teaching. Select one of given options.previous_experience_otherText if individual selectedOtherprevious_experience_explanationFree text field to describe teaching experiencenonprofit_teaching_experienceFree text field to describe nonprofit teaching experiencereasonFree text field to describe why individual wants to attend Instructor Trainingdata_privacy_agreementConsent agreeing to The Carpentries' data privacy policycode_of_conduct_agreementConsent agreeing to The Carpentries' Code of Conductuser_notesFree text field with notes from the individualcreated_atandlast_updated_atDates the record was created and last updated. Automatically generated by database.
Training progress¶
workshops_trainingrequirement - Lists all available steps towards Instructor certification (Training Event, Welcome Session, etc.)
idSequential, automatically assigned integer.nameName of requirement (Demo, Welcome Session, etc.)url_requiredNotes whether a URL is required for this type of training requirement. Currently, no requirements require a URL, but some Get Involved activities do (see below).event_requiredNotes whether an event is required for this type of training requirement. This only applies to the Training (the actual event they attended).involvement_requiredNotes whether an activity must be provided for this type of training requirement. This only applies to the Get Involved requirement where multiple different activities are acceptable.
trainings_involvement - Lists all activities that are accepted as part of the Get Involved training requirement (GitHub contribution, Workshop Instructor/helper, etc.) Note that this table uses the trainings_ prefix, rather than workshops_.
idSequential, automatically assigned integer.nameA short name for the activity (GitHub Contribution, Community Meeting, etc.)display_nameA fully descriptive name for the activity (e.g. Attended an Instructor meeting, regional meetup, or other community meeting)url_requiredNotes whether a URL must be provided for this type of activity.date_requiredNotes whether a date must be provided for this type of activity. Currently, all activities require a date.notes_requiredNotes whether text notes must be provided for this type of activity (such as when tracking an activity that is not covered by the existing options). These notes can come from either the trainee or an administrator.
workshops_trainingprogress - Connects workshops_trainingrequirement, trainings_involvement, and workshops_person to show what Persons have completed what steps of the checkout process.
idSequential, automatically assigned integer.created_atandlast_updated_atDates the record was created and last updated. Automatically generated by database.stateState of the trainee's progress.p: passa: ask to repeatf: failn: not evaluated yet
requirement_idid of the requirement that is being recorded. This is linked to theworkshops_trainingrequirementtableinvolvement_type_idonly for Get Involved requirement, id of the activity that is being recorded. This is linked to thetrainings_involvementtabletrainee_idid of the trainee being evaluated. This is linked to theworkshops_persontableurlLink to a GitHub contribution, workshop website, etc.event_idid of the event this trainee was at. This is linked to theworkshops_eventtabledateonly for Get Involved requirement, the date of the activity (first day if the activity covered multiple days)trainee_notesonly for Get Involved requirement, notes submitted by the traineenotesNotes written by an administrator
Consents¶
Consent Terms¶
consents_term - Stores all types of consent terms in AMY (e.g. privacy policy, permission to contact).
slugslug of the term. Used to uniquely identify the term.contentcontent of the term. This text is shown to users when they consent.training_request_contentif set, the regularcontentis replaced with this text when displaying this term on the instructor training request form.required_typedetermines whether or not a term is considered required for the user or not. If required it is presented to the user when they first log in.help_textadditional text shown to the user in order to give more context on the term.short_descriptiona short description of the consent, shown in the admin view of a profilearchived_atif this term is archived, a timestamp of when it was archived
Consent Term Options¶
consents_termoption - Stores all options for all terms in AMY. Options are displayed when the user is asked to consent to a particular term. Options are considered answer choices for the term.
term_idid of the term this option belongs to. This is linked to theconsents_termtable. Unarchived term options attached to a term will be displayed to the user when the term is rendered.option_typedetermines whether or not a term option is considered as an agreement or a decline for that term.contentthe text displayed to the user when the term is rendered.archived_ata timestamp of when the option was archived orNULLif it wasn't
Individual Consent¶
consents_consent - Stores all consents for all users in AMY.
person_idid of the person providing the consent. This is linked to theworkshops_persontable.term_idid of the term this consent applies to. This is linked to theconsents_termtable. There is a check on the Consent model to ensure the given TermOption belongs to the Term.term_option_idid of the term option chosen in this consent. This is linked to theconsents_termoptiontable. When this field is null, the consent has not been set by the user.archived_atif this consent is archived, a timestamp of when it was archived.
Training Request Consent¶
consents_trainingrequestconsent Stores all consents for all instructor training requests in AMY.
training_request_idid of the training request this consent option belongs to. This is linked to theworkshops_trainingrequesttable.term_idid of the term this consent applies to. This is linked to theconsents_termtable. There is a check on the Consent model to ensure the given TermOption belongs to the Term.term_option_idid of the term option chosen in this consent. This is linked to theconsents_termoptiontable. When this field is null, the consent has not been set by the user.archived_ata timestamp of when the consent was archived orNULLif it wasn't.
Additional Tables in AMY¶
Badges¶
workshops_badgeLists all available badges (Instructor, Trainer, etc.)idSequential, automatically assigned integer. This is used bybadge_idin theworkshops_awardtable.criteriaDescription of what this badge istitleVerbose, human friendly name of badge (e.g., Lesson Developer or Trainer)-
name"back-end" badge name (e.g., lesson-developer, trainer) -
workshops_awardConnectsworkshops_badgeandworkshops_persontables to show what Badges have been awarded to what Persons idSequential, automatically assigned integer.awardedDate the badge was awarded. This is usually the date it was recorded in AMY, not the date the person completed all requirements.badge_idAn integer representing the badge. This is linked to theworkshops_badgetableevent_idAn integer representing the event the badge came from. This is linked to theworkshops_eventtableperson_idAn integer representing the person who got the badge. This is linked to theworkshops_persontableawarded_by_idAn integer representing the person who awarded the badge (entered it in AMY). This is linked to theworkshops_persontable
Roles¶
workshops_roleLists all available roles (Instructor, Helper, Learner, etc.)idSequential, automatically assigned integer.verbose_nameVerbose, human friendly name of role (e.g., Workshop host, Supporting Instructor)-
name"back end" task name (e.g., workshop-host, supporting-instructor) -
workshops_taskConnectsworkshops_role,workshops_event, andworkshops_persontables to show what what Persons have served in what Roles at what Events idSequential, automatically assigned integer.event_idAn integer representing the event the person was at. This is linked to theworkshops_eventtableperson_idAn integer representing the person who was at the event. This is linked to theworkshops_persontablerole_idAn integer representing the person's role. This is linked to theworkshops_persontableseat_membership_idUsed for Instructor Training Learner role only. An integer representing the membership this seat was assigned to.seat_publicUsed for Instructor Training Learner role only. Determines if the seat counts as public or in-house for the specific membership.seat_open_trainingUsed for Instructor Training Learner role only. Boolean field noting whether this was an open (non-member) training seat.
Tags¶
workshops_tagLists all availabe tags for an Event (SWC, DC, LC, Online, Pilot, Circuits, etc.)idSequential, automatically assigned integer.name"back end" tag namedetailsDescription of what tag is used for-
priorityUsed to control the sort order in the AMY web interface. Not relevant for any other queries. -
workshops_event_tagsConnectsworkshops_tagandworkshops_eventto show what Tags have been applied to what Events idSequential, automatically assigned integer.event_idAn integer representing the event that got that tag. This is linked to theworkshops_eventtabletag_idAn integer representing the tag that was assigned to that event. This is linked to theworkshops_tagtable.
Workshop requests, workshop inquiries, and self-organised submissions¶
workshops_workshoprequestList of all workshop requests.personal,family,emailSee Persons.institutionInteger representing the individual's affiliation. Linked to theworkshops_organizationstable. May be empty as some people specify their institution using free text fields.member_codeThe member code that this workshop should be associated with if accepted. Optional.online_inpersonOptions areOnline,In person,Not sure.location,country,languageSee Events.requested_workshop_typesList of integers representing the curricula requested for the workshop. Linked to theworkshops_curriculumtable.-
carpentries_info_sourceHow the individual found out about The Carpentries. -
extrequests_workshopinquiryList of all workshop inquiries. Relevant fields closely mirror those underworkshops_workshoprequest. -
extrequests_selforganisedsubmissionList of all self-organized submissions. start,end,workshop_url,location,country,languageSee Events.workshop_formatOptions areStandard two-day Carpentries workshop,Short session (less than two days),Modules taught over a period of time (several weeks, one semester, etc.), andOther.workshop_format_otherText if individual selectedOther.
workshop_typesInteger representing the curricula requested for the workshop. Linked to theworkshops_curriculumtable.workshop_types_other_explainText if individual selectedMix & Match.
Training requests¶
workshops_trainingrequestLists all training requests submitted by community members. List of fields omits free-text fields except for "other" options.idSequential, automatically assigned integer.review_processEither preapproved (meaning associated with a membership) or open.member_codeThe member code that this training seat should be associated with if accepted. Only present ifreview_processis preapproved.personal,family,email,github,affiliation,country,occupationSee Persons.underresourcedA boolean field indicating whether the individual's affiliation is small, remote, or under-resourced.domainsA list of areas where the individual has expertise.domains_otherText if individual selectedOther.
underrepresentedWhether the individual self-identifies with a group that is under-represented in research and/or computing. Options areYes,No, andPrefer not to say.underrepresented_detailsText if individual chose to share more information.
previous_involvementList of types of previous involvement with the Carpentries, e.g. Helper, Learner.previous_trainingAmount of previous teacher/instructor training.previous_training_otherText if individual selectedOther.
previous_experienceAmount of previous teaching experience.previous_experience_otherText if individual selectedOther.
programming_language_usage_frequencyHow regularly the individual uses tools that The Carpentries teach, such as R, Python, and Git.checkout_intentWhether the individual intends to complete checkout.teaching_intentWhether the individual intends to teach Carpentries workshops once certified. This may be local, central, or both.teaching_frequency_expectationHow often the individual intends to teach Carpentries workshops once certified.teaching_frequency_expectation_otherText if individual selectedOther.
score_autoAutomatic score generated by AMY.score_manualManually entered score.
Training progress¶
workshops_trainingrequirementLists all available steps towards Instructor certification (Training Event, Welcome Session, etc.)idSequential, automatically assigned integer.nameName of requirement (Demo, Welcome Session, etc.)url_requiredNotes whether a URL is required for this type of training requirement. Currently, no requirements require a URL, but some Get Involved activities do (see below).event_requiredNotes whether an event is required for this type of training requirement. This only applies to the Training (the actual event they attended).-
involvement_requiredNotes whether an activity must be provided for this type of training requirement. This only applies to the Get Involved requirement where multiple different activities are acceptable. -
trainings_involvementLists all activities that are accepted as part of the Get Involved training requirement (GitHub contribution, Workshop Instructor/helper, etc.) Note that this table uses thetrainings_prefix, rather thanworkshops_. idSequential, automatically assigned integer.nameA short name for the activity (GitHub Contribution, Community Meeting, etc.)display_nameA fully descriptive name for the activity (e.g. Attended an Instructor meeting, regional meetup, or other community meeting)url_requiredNotes whether a URL must be provided for this type of activity.date_requiredNotes whether a date must be provided for this type of activity. Currently, all activities require a date.-
notes_requiredNotes whether text notes must be provided for this type of activity (such as when tracking an activity that is not covered by the existing options). These notes can come from either the trainee or an administrator. -
workshops_trainingprogressConnectsworkshops_trainingrequirement,trainings_involvement, andworkshops_personto show what Persons have completed what steps of the checkout process. idSequential, automatically assigned integer.created_atandlast_updated_atDates the record was created and last updated. Automatically generated by database.stateState of the trainee's progress.p: passa: ask to repeatf: failn: not evaluated yet
requirement_idid of the requirement that is being recorded. This is linked to theworkshops_trainingrequirementtableinvolvement_type_idonly for Get Involved requirement, id of the activity that is being recorded. This is linked to thetrainings_involvementtabletrainee_idid of the trainee being evaluated. This is linked to theworkshops_persontableurlLink to a GitHub contribution, workshop website, etc.event_idid of the event this trainee was at. This is linked to theworkshops_eventtabledateonly for Get Involved requirement, the date of the activity (first day if the activity covered multiple days)trainee_notesonly for Get Involved requirement, notes submitted by the traineenotesNotes written by an administrator
Term¶
consents_term - Stores all consent terms in AMY (e.g. privacy policy, permission to contact).
Archive Behavior¶
When a term is archived, that term's associated options and consents are archived as well. If the term was required, once archived it is no longer required in AMY.
Commonly used fields¶
slugslug of the term. Used to uniquely identify the term.contentcontent of the term. This text is shown to users when they consent.training_request_contentif set, the regularcontentis replaced with this text when displaying this term on the instructor training request form.required_typedetermines whether or not a term is considered required for the user or not. If required it is presented to the user when they first log in.help_textadditional text shown to the user in order to give more context on the term.short_descriptiona short description of the consent, shown in the admin view of a profilearchived_atif this term is archived, a timestamp of when it was archived
TermOption¶
consents_termoption - Stores all options for all terms in AMY. Options are displayed when the user is asked to consent to a particular term. Options are considered answer choices for the term.
Archive Behavior¶
When an option is archived, any consents that rely on that option are archived and a new unset consent is created by AMY for the user. If the term the option was attached to is required, archiving the option may result in an email sent to any users who answered with this option.
Commonly used fields¶
term_idid of the term this option belongs to. This is linked to theconsents_termtable. Unarchived term options attached to a term will be displayed to the user when the term is rendered.option_typedetermines whether or not a term option is considered as an agreement or a decline for that term.contentthe text displayed to the user when the term is rendered.archived_ata timestamp of when the option was archived orNULLif it wasn't
Consent¶
consents_consent - Stores all consents for all users in AMY.
Archive Behavior¶
When consents are archived, a new unset consent is created by AMY for each term involved.
Commonly used fields¶
person_idid of the person providing the consent. This is linked to theworkshops_persontable.term_idid of the term this consent applies to. This is linked to theconsents_termtable. There is a check on the Consent model to ensure the given TermOption belongs to the Term.term_option_idid of the term option chosen in this consent. This is linked to theconsents_termoptiontable. When this field is null, the consent has not been set by the user.archived_atif this consent is archived, a timestamp of when it was archived.
TrainingRequestConsent¶
consents_trainingrequestconsent Stores all consents for all instructor training requests in AMY.
Archive Behavior¶
When training request consents are archived, a new unset consent is created by AMY for each term involved.
Commonly used fields¶
training_request_idid of the training request this consent option belongs to. This is linked to theworkshops_trainingrequesttable.term_idid of the term this consent applies to. This is linked to theconsents_termtable. There is a check on the Consent model to ensure the given TermOption belongs to the Term.term_option_idid of the term option chosen in this consent. This is linked to theconsents_termoptiontable. When this field is null, the consent has not been set by the user.archived_ata timestamp of when the consent was archived orNULLif it wasn't.