class AddFieldsToStudent < ActiveRecord::Migration[6.0] def change remove_reference :sis_core_students, :academic_programme, index: true remove_column :sis_core_students, :full_name, :string add_column :sis_core_students, :alternative_email_address, :string add_column :sis_core_students, :primary_phone_number, :string add_column :sis_core_students, :gender, :string add_column :sis_core_students, :address, :string add_column :sis_core_students, :picture_url, :string add_column :sis_core_students, :mother_occupation, :string add_column :sis_core_students, :mother_education_level, :string add_column :sis_core_students, :mother_mobile_number, :string add_column :sis_core_students, :mother_office_phone_number, :string add_column :sis_core_students, :mother_house_number, :string add_column :sis_core_students, :mother_woreda, :string add_column :sis_core_students, :mother_zone, :string add_column :sis_core_students, :mother_region, :string add_column :sis_core_students, :father_full_name, :string add_column :sis_core_students, :father_occupation, :string add_column :sis_core_students, :father_education_level, :string add_column :sis_core_students, :father_mobile_number, :string add_column :sis_core_students, :father_office_phone_number, :string add_column :sis_core_students, :father_house_number, :string add_column :sis_core_students, :father_woreda, :string add_column :sis_core_students, :father_zone, :string add_column :sis_core_students, :father_region, :string add_column :sis_core_students, :middle_name, :string add_column :sis_core_students, :place_of_birth_town, :string add_column :sis_core_students, :place_of_birth_region, :string add_column :sis_core_students, :place_of_birth_country, :string add_column :sis_core_students, :house_number, :string add_column :sis_core_students, :advisor_id, :integer add_column :sis_core_students, :woreda, :string add_column :sis_core_students, :town, :string add_column :sis_core_students, :zone, :string add_column :sis_core_students, :region, :string add_column :sis_core_students, :native_language, :string add_column :sis_core_students, :marital_status, :string add_column :sis_core_students, :physically_disabled, :boolean, default: false add_column :sis_core_students, :nature_of_disability, :string add_column :sis_core_students, :blood_type, :string add_column :sis_core_students, :health_problem, :string add_column :sis_core_students, :tuition_payment_modality, :string add_column :sis_core_students, :emergency_contact_person, :string add_column :sis_core_students, :emergency_contact_person_relationship, :string add_column :sis_core_students, :emergency_contact_telephone_number, :string add_column :sis_core_students, :emergency_contact_office_number, :string add_column :sis_core_students, :emergency_contact_mobile_number, :string add_column :sis_core_students, :emergency_contact_house_number, :string add_column :sis_core_students, :emergency_contact_person_woreda, :string add_column :sis_core_students, :emergency_contact_person_town, :string add_column :sis_core_students, :emergency_contact_person_zone, :string add_column :sis_core_students, :emergency_contact_person_region, :string add_column :sis_core_students, :second_emergency_contact_person, :string add_column :sis_core_students, :second_emergency_contact_person_relationship, :string add_column :sis_core_students, :second_emergency_contact_telephone_number, :string add_column :sis_core_students, :tuition_payer_email, :string add_column :sis_core_students, :tuition_payer_mobile_number, :string add_column :sis_core_students, :guardian_one_full_name, :string add_column :sis_core_students, :guardian_one_email_address, :string add_column :sis_core_students, :guardian_one_phone_number, :string add_column :sis_core_students, :mother_full_name, :string add_column :sis_core_students, :guardian_two_full_name, :string add_column :sis_core_students, :guardian_two_email_address, :string add_column :sis_core_students, :guardian_two_phone_number, :string add_column :sis_core_students, :subcity, :string add_reference :sis_core_students, :level, index: { name: 'level_on_student' }, foreign_key: { to_table: :sis_core_lookups } add_reference :sis_core_students, :semester, index: { name: 'semester_on_student' }, foreign_key: { to_table: :sis_core_semesters } add_reference :sis_core_students, :entry, index: { name: 'entry_on_student' }, foreign_key: { to_table: :sis_core_lookups } add_reference :sis_core_students, :user, index: { name: 'user_on_student' }, foreign_key: { to_table: :sis_core_users } add_reference :sis_core_students, :programme, index: { name: 'programme_on_student' }, foreign_key: { to_table: :sis_core_programmes } add_reference :sis_core_students, :programme_level, index: { name: 'prog_level_on_student' }, foreign_key: { to_table: :sis_core_lookups } add_reference :sis_core_students, :programme_type, index: { name: 'prog_type_on_student' }, foreign_key: { to_table: :sis_core_lookups } end end