You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plume/migrations/postgres/2018-09-07-212003_fix_avata.../up.sql

8 lines
200 B
SQL

-- 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;