Skip to content

Instantly share code, notes, and snippets.

@mgirard772
Created August 27, 2020 13:54
Show Gist options
  • Save mgirard772/8797ef064af57127debbd211a63b7c56 to your computer and use it in GitHub Desktop.
Save mgirard772/8797ef064af57127debbd211a63b7c56 to your computer and use it in GitHub Desktop.
CREATE TABLE public.comments
(
id VARCHAR(36) primary key,
asset CHARACTER varying,
body CHARACTER varying,
commentable VARCHAR(36),
commentabletype CHARACTER varying,
companyid VARCHAR(36),
createdat timestamp WITHOUT time zone DEFAULT ('now'::text)::timestamp with time zone,
notifcationsenabled boolean DEFAULT FALSE,
updatedat timestamp WITHOUT time zone DEFAULT ('now'::text)::timestamp with time zone,
userid varchar(36),
videoasset CHARACTER varying,
childrencount int,
clientid varchar(36),
parentcommentid varchar(36),
foreign key (companyid) references public.companies(id),
foreign key (userid) references public.users(id),
foreign key (clientid) references public.clients(id)
)
DISTSTYLE EVEN
INTERLEAVED SORTKEY (clientid, companyid, userid, commentabletype, commentable, id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment