-
Notifications
You must be signed in to change notification settings - Fork 14
/
create_tables.sql
114 lines (81 loc) · 2.37 KB
/
create_tables.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
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
112
113
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: chat_log; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE chat_log (
id integer NOT NULL,
channel character varying(64) NOT NULL,
sender character varying(64) NOT NULL,
message character varying(512) NOT NULL,
date bigint NOT NULL
);
--
-- Name: chat_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE chat_log_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: chat_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE chat_log_id_seq OWNED BY chat_log.id;
--
-- Name: stream_log; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE stream_log (
id integer NOT NULL,
channel character varying(64) NOT NULL,
title character varying(128),
game character varying(64),
viewers integer NOT NULL,
date bigint NOT NULL
);
--
-- Name: stream_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE stream_log_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: stream_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE stream_log_id_seq OWNED BY stream_log.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY chat_log ALTER COLUMN id SET DEFAULT nextval('chat_log_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY stream_log ALTER COLUMN id SET DEFAULT nextval('stream_log_id_seq'::regclass);
--
-- Name: chat_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY chat_log
ADD CONSTRAINT chat_log_pkey PRIMARY KEY (id);
--
-- Name: stream_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY stream_log
ADD CONSTRAINT stream_log_pkey PRIMARY KEY (id);
CREATE INDEX chat_log_date_idx ON chat_log (date);
CREATE INDEX chat_log_channel_idx ON chat_log (channel);
--
-- PostgreSQL database dump complete
--