penpot/backend/src/app/migrations/sql/0039-fix-some-on-delete-triggers.sql
Andrey Antukh 16469daff3 Many improvements to the database layer.
- Proper handling of referenced tables deletion.
- Proper handling of storage referenced tables deletion.
- Remove of obsolete tables and triggers.
2021-01-11 08:06:02 +01:00

9 lines
419 B
SQL

ALTER TABLE file_library_rel
DROP CONSTRAINT file_library_rel_library_file_id_fkey,
ADD CONSTRAINT file_library_rel_library_file_id_fkey
FOREIGN KEY (library_file_id) REFERENCES file(id) ON DELETE CASCADE;
ALTER TABLE team_profile_rel
DROP CONSTRAINT team_profile_rel_profile_id_fkey,
ADD CONSTRAINT team_profile_rel_profile_id_fkey
FOREIGN KEY (profile_id) REFERENCES profile(id) ON DELETE CASCADE;