Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
tutors type left join
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjo-alvarez committed Jan 15, 2025
1 parent 4e68319 commit e7a6610
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ DELETE FROM public.tutors_type WHERE id IN (1,2);
INSERT INTO public.tutors_type (id, "type") VALUES(1, 'Titular');
INSERT INTO public.tutors_type (id, "type") VALUES(2, 'Apoyo');

UPDATE tutor_bootcamp tb SET tutor_type=2 WHERE NOT EXISTS (SELECT 1 FROM tutors_type tt WHERE tb.tutor_type=tt.id);

ALTER TABLE tutor_bootcamp
ADD CONSTRAINT fk_tutor_type_bootcamp FOREIGN KEY (tutor_type) REFERENCES tutors_type(id);

0 comments on commit e7a6610

Please sign in to comment.