mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-15 08:27:42 +00:00
f9b9c595cf
* some tests * more tests * tidy up go.mod * more tests * add postgres * beep * again * Set up schema * fix device test
24 lines
1 KiB
SQL
24 lines
1 KiB
SQL
-- Table Definition ----------------------------------------------
|
|
|
|
CREATE TABLE watchers (
|
|
id SERIAL PRIMARY KEY,
|
|
device_id integer REFERENCES devices(id) ON DELETE CASCADE,
|
|
watchee_id integer,
|
|
upvotes integer DEFAULT 0,
|
|
keyword character varying(32) DEFAULT ''::character varying,
|
|
flair character varying(32) DEFAULT ''::character varying,
|
|
domain character varying(32) DEFAULT ''::character varying,
|
|
account_id integer REFERENCES accounts(id) ON DELETE CASCADE,
|
|
created_at double precision DEFAULT '0'::double precision,
|
|
hits integer DEFAULT 0,
|
|
type integer DEFAULT 0,
|
|
last_notified_at double precision DEFAULT '0'::double precision,
|
|
label character varying(64) DEFAULT ''::character varying,
|
|
author character varying(32) DEFAULT ''::character varying,
|
|
subreddit character varying(32) DEFAULT ''::character varying
|
|
);
|
|
|
|
-- Indices -------------------------------------------------------
|
|
|
|
CREATE INDEX watchers_type_watchee_id_idx ON watchers(type int4_ops,watchee_id int4_ops);
|
|
|