forked from MarseyWorld/MarseyWorld
add unique constraint
parent
f41c077d86
commit
1c34e1155c
|
@ -16,6 +16,9 @@ CREATE SEQUENCE public.media_usages_id_seq
|
|||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
ALTER TABLE ONLY public.media_usages
|
||||
ADD CONSTRAINT media_usages_unique UNIQUE NULLS NOT DISTINCT (filename, post_id, comment_id);
|
||||
|
||||
ALTER SEQUENCE public.media_usages_id_seq OWNED BY public.media_usages.id;
|
||||
|
||||
ALTER TABLE ONLY public.media_usages ALTER COLUMN id SET DEFAULT nextval('public.media_usages_id_seq'::regclass);
|
||||
|
|
Loading…
Reference in New Issue