ALTER TABLE members_qualifications
    DROP FOREIGN KEY fk_members_qualifications_course_id,
    DROP FOREIGN KEY fk_members_qualifications_awarded_by,
    DROP FOREIGN KEY fk_members_qualifications_revoked_by,
    DROP FOREIGN KEY fk_members_qualifications_source_event,
    DROP KEY uq_members_qualifications_member_course,
    DROP KEY idx_members_qualifications_active,
    DROP KEY idx_members_qualifications_source_event,
    DROP COLUMN course_id,
    DROP COLUMN active,
    DROP COLUMN awarded_by_id,
    DROP COLUMN revoked_by_id,
    DROP COLUMN revoked_reason,
    DROP COLUMN revoked_at,
    DROP COLUMN source_course_event_id,
    ADD COLUMN qualification_id INT(11) DEFAULT 0,
    ADD KEY fk_members_qualifications_qualifications_id (qualification_id),
    ADD CONSTRAINT fk_members_qualifications_qualifications_id FOREIGN KEY (qualification_id) REFERENCES qualifications(id) ON UPDATE CASCADE;
