Adding uniques.

This commit is contained in:
Dessalines 2020-08-25 12:45:47 -04:00
parent 5b4722b66c
commit 447e210704
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,9 @@
-- Drop the uniques
alter table private_message drop constraint idx_private_message_ap_id;
alter table post drop constraint idx_post_ap_id;
alter table comment drop constraint idx_comment_ap_id;
alter table user_ drop constraint idx_user_actor_id;
alter table community drop constraint idx_community_actor_id;
alter table private_message alter column ap_id set not null;
alter table private_message alter column ap_id set default 'http://fake.com';

View file

@ -47,3 +47,10 @@ alter table post alter column ap_id set default generate_unique_changeme();
alter table comment alter column ap_id set not null;
alter table comment alter column ap_id set default generate_unique_changeme();
-- Add the uniques, for user_ and community too
alter table private_message add constraint idx_private_message_ap_id unique (ap_id);
alter table post add constraint idx_post_ap_id unique (ap_id);
alter table comment add constraint idx_comment_ap_id unique (ap_id);
alter table user_ add constraint idx_user_actor_id unique (actor_id);
alter table community add constraint idx_community_actor_id unique (actor_id);