-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplain_db_pgsql
112 lines (81 loc) · 2.79 KB
/
plain_db_pgsql
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.2
-- Dumped by pg_dump version 12.2
-- Started on 2020-03-12 12:07:21
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 = '';
SET default_table_access_method = heap;
--
-- TOC entry 203 (class 1259 OID 16512)
-- Name: Sessions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Sessions" (
"UserId" character varying(20) NOT NULL,
"RefreshToken" uuid NOT NULL,
"UserAgent" character varying(200) NOT NULL,
"FingerPrint" character varying(200) NOT NULL,
"IP" character varying(15) NOT NULL,
"ExpiresIn" bigint NOT NULL,
"СreatedAt" timestamp with time zone DEFAULT now(),
"UpdatedAt" timestamp with time zone DEFAULT now()
);
ALTER TABLE public."Sessions" OWNER TO postgres;
--
-- TOC entry 202 (class 1259 OID 16395)
-- Name: Users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Users" (
"Login" character varying(20) NOT NULL,
"Email" character varying(50),
"Password_hash" character varying(32),
"PrivateKey" character varying NOT NULL,
"UnixTime" bigint
);
ALTER TABLE public."Users" OWNER TO postgres;
--
-- TOC entry 2824 (class 0 OID 16512)
-- Dependencies: 203
-- Data for Name: Sessions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Sessions" ("UserId", "RefreshToken", "UserAgent", "FingerPrint", "IP", "ExpiresIn", "СreatedAt", "UpdatedAt") FROM stdin;
\.
--
-- TOC entry 2823 (class 0 OID 16395)
-- Dependencies: 202
-- Data for Name: Users; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Users" ("Login", "Email", "Password_hash", "PrivateKey", "UnixTime") FROM stdin;
\.
--
-- TOC entry 2695 (class 2606 OID 16544)
-- Name: Sessions Sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Sessions"
ADD CONSTRAINT "Sessions_pkey" PRIMARY KEY ("RefreshToken");
--
-- TOC entry 2693 (class 2606 OID 16470)
-- Name: Users Users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Users"
ADD CONSTRAINT "Users_pkey" PRIMARY KEY ("Login");
--
-- TOC entry 2696 (class 2606 OID 16538)
-- Name: Sessions Sessions_UserId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Sessions"
ADD CONSTRAINT "Sessions_UserId_fkey" FOREIGN KEY ("UserId") REFERENCES public."Users"("Login") ON DELETE CASCADE NOT VALID;
-- Completed on 2020-03-12 12:07:21
--
-- PostgreSQL database dump complete
--