Plume/migrations/postgres/2018-12-25-164502_media-cover-deletion/up.sql
fdb-hiroshima aa72334dc6
Allow for media cover deletion (#387)
* Allow for media cover deletion

Fix #356

* Fix sqlite migrations
2019-01-05 22:11:54 +01:00

5 lines
196 B
SQL

-- Your SQL goes here
ALTER TABLE posts DROP CONSTRAINT posts_cover_id_fkey;
ALTER TABLE posts ADD CONSTRAINT posts_cover_id_fkey FOREIGN KEY (cover_id) REFERENCES medias(id) ON DELETE SET NULL;