ALTER TABLE exam_prep.lesson_practices DROP CONSTRAINT IF EXISTS lesson_practices_persona_id_fkey;

UPDATE exam_prep.lesson_practices
SET persona_id = NULL;

ALTER TABLE exam_prep.lesson_practices
    ADD CONSTRAINT lesson_practices_persona_id_fkey FOREIGN KEY (persona_id) REFERENCES users (id) ON DELETE SET NULL;

ALTER TABLE lms_practices DROP CONSTRAINT IF EXISTS lms_practices_persona_id_fkey;

UPDATE lms_practices
SET persona_id = NULL;

ALTER TABLE lms_practices
    ADD CONSTRAINT lms_practices_persona_id_fkey FOREIGN KEY (persona_id) REFERENCES users (id) ON DELETE SET NULL;

DROP TABLE IF EXISTS lms_personas;
