-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path0003_userQueueItems_init.sql
80 lines (56 loc) · 2.31 KB
/
0003_userQueueItems_init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.5 (Debian 11.5-3.pgdg90+1)
-- Dumped by pg_dump version 12.4
-- SET statement_timeout = 0;
-- SET lock_timeout = 0;
-- SET idle_in_transaction_session_timeout = 0;
-- SET client_encoding = 'UTF8';
-- SET standard_conforming_strings = on;
-- SELECT pg_catalog.set_config('search_path', '', false);
-- SET check_function_bodies = false;
-- SET xmloption = content;
-- SET client_min_messages = warning;
-- SET row_security = off;
-- SET default_tablespace = '';
--
-- Name: userQueueItems; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."userQueueItems" (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
"queuePosition" integer DEFAULT 0 NOT NULL,
"createdAt" timestamp without time zone DEFAULT now() NOT NULL,
"updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
"episodeId" character varying(14),
"mediaRefId" character varying(14),
"ownerId" character varying(14) NOT NULL
);
ALTER TABLE public."userQueueItems" OWNER TO postgres;
--
-- Name: userQueueItems PK_1d8e6ae23c7d3b62412c010d281; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."userQueueItems"
ADD CONSTRAINT "PK_1d8e6ae23c7d3b62412c010d281" PRIMARY KEY (id);
--
-- Name: IDX_b651ccc2eec2cb1936244ea742; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX "IDX_b651ccc2eec2cb1936244ea742" ON public."userQueueItems" USING btree ("ownerId");
--
-- Name: userQueueItems FK_2367e28002d5b0e577e5084b967; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."userQueueItems"
ADD CONSTRAINT "FK_2367e28002d5b0e577e5084b967" FOREIGN KEY ("episodeId") REFERENCES public.episodes(id);
--
-- Name: userQueueItems FK_5d3167b5c0df34e3a550fd8d6e8; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."userQueueItems"
ADD CONSTRAINT "FK_5d3167b5c0df34e3a550fd8d6e8" FOREIGN KEY ("mediaRefId") REFERENCES public."mediaRefs"(id);
--
-- Name: userQueueItems FK_b651ccc2eec2cb1936244ea742a; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."userQueueItems"
ADD CONSTRAINT "FK_b651ccc2eec2cb1936244ea742a" FOREIGN KEY ("ownerId") REFERENCES public.users(id) ON DELETE CASCADE;
--
-- PostgreSQL database dump complete
--