Plume/migrations/postgres/2018-09-07-212003_fix_avatar_deletion/up.sql

8 lines
200 B
MySQL
Raw Normal View History

-- Your SQL goes here
ALTER TABLE users
DROP CONSTRAINT users_avatar_id_fkey,
ADD CONSTRAINT users_avatar_id_fkey
FOREIGN KEY (avatar_id)
REFERENCES medias(id)
ON DELETE SET NULL;