class ConsentForm

Schema Information

Table name: consent_forms

id                                  :bigint           not null, primary key
address_line_1                      :string
address_line_2                      :string
address_postcode                    :string
address_town                        :string
archived_at                         :datetime
confirmation_sent_at                :datetime
date_of_birth                       :date
education_setting                   :integer
ethnic_background                   :integer
ethnic_background_other             :string
ethnic_group                        :integer
family_name                         :text
given_name                          :text
health_answers                      :jsonb            not null
nhs_number                          :string
notes                               :text             default(""), not null
parent_contact_method_other_details :string
parent_contact_method_type          :string
parent_email                        :string
parent_full_name                    :string
parent_phone                        :string
parent_phone_receive_updates        :boolean          default(FALSE), not null
parent_relationship_other_name      :string
parent_relationship_type            :string
preferred_family_name               :string
preferred_given_name                :string
recorded_at                         :datetime
school_confirmed                    :boolean
use_preferred_name                  :boolean
created_at                          :datetime         not null
updated_at                          :datetime         not null
original_session_id                 :bigint
school_id                           :bigint
team_location_id                    :bigint           not null

Indexes

index_consent_forms_on_nhs_number                  (nhs_number)
index_consent_forms_on_original_session_id         (original_session_id)
index_consent_forms_on_recorded                    (id) WHERE (recorded_at IS NOT NULL)
index_consent_forms_on_school_id                   (school_id)
index_consent_forms_on_team_location_id            (team_location_id)
index_consent_forms_on_unmatched_and_not_archived  (id) WHERE ((recorded_at IS NOT NULL) AND (archived_at IS NULL))

Foreign Keys

fk_rails_...  (original_session_id => sessions.id)
fk_rails_...  (school_id => locations.id)
fk_rails_...  (team_location_id => team_locations.id)