mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-07-30 09:48:47 -04:00
Make content_owner_id nullable in reports table
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
create table if not exists
|
||||
reports (
|
||||
content_id text not null,
|
||||
content_owner_id text not null,
|
||||
content_type text not null,
|
||||
created_time timestamp with time zone default now(),
|
||||
description text,
|
||||
id text default uuid_generate_v4 () not null,
|
||||
parent_id text,
|
||||
parent_type text,
|
||||
user_id text
|
||||
);
|
||||
reports
|
||||
(
|
||||
content_id text not null,
|
||||
content_owner_id text,
|
||||
content_type text not null,
|
||||
created_time timestamp with time zone default now(),
|
||||
description text,
|
||||
id text default uuid_generate_v4() not null,
|
||||
parent_id text,
|
||||
parent_type text,
|
||||
user_id text
|
||||
);
|
||||
|
||||
-- Foreign Keys
|
||||
alter table reports
|
||||
add constraint reports_content_owner_id_fkey foreign key (content_owner_id) references users (id) on delete set null;
|
||||
add constraint reports_content_owner_id_fkey foreign key (content_owner_id) references users (id) on delete set null;
|
||||
|
||||
alter table reports
|
||||
add constraint reports_user_id_fkey foreign key (user_id) references users (id) on delete set null;
|
||||
add constraint reports_user_id_fkey foreign key (user_id) references users (id) on delete set null;
|
||||
|
||||
-- Row Level Security
|
||||
alter table reports enable row level security;
|
||||
alter table reports
|
||||
enable row level security;
|
||||
|
||||
Reference in New Issue
Block a user