CreateEneraptorDatabasebackup » History » Version 6
Aleksander Bešir, 28.12.2010 13:47
1 | 5 | Aleksander Bešir | h1. Creating Eneraptor Database for development purposes |
---|---|---|---|
2 | 5 | Aleksander Bešir | |
3 | 6 | Aleksander Bešir | This query can be downloaded: attachment:make.backup |
4 | 6 | Aleksander Bešir | |
5 | 4 | Aleksander Bešir | <pre><code class="sql"> |
6 | 1 | Aleksander Bešir | -- |
7 | 1 | Aleksander Bešir | -- PostgreSQL database dump |
8 | 1 | Aleksander Bešir | -- |
9 | 1 | Aleksander Bešir | |
10 | 1 | Aleksander Bešir | -- Dumped from database version 9.0.1 |
11 | 1 | Aleksander Bešir | -- Dumped by pg_dump version 9.0.1 |
12 | 1 | Aleksander Bešir | -- Started on 2010-12-28 12:36:32 |
13 | 1 | Aleksander Bešir | |
14 | 1 | Aleksander Bešir | SET statement_timeout = 0; |
15 | 1 | Aleksander Bešir | SET client_encoding = 'UTF8'; |
16 | 1 | Aleksander Bešir | SET standard_conforming_strings = off; |
17 | 1 | Aleksander Bešir | SET check_function_bodies = false; |
18 | 1 | Aleksander Bešir | SET client_min_messages = warning; |
19 | 1 | Aleksander Bešir | SET escape_string_warning = off; |
20 | 1 | Aleksander Bešir | |
21 | 1 | Aleksander Bešir | -- |
22 | 1 | Aleksander Bešir | -- TOC entry 1794 (class 1262 OID 16392) |
23 | 1 | Aleksander Bešir | -- Name: eneraptor-db; Type: DATABASE; Schema: -; Owner: postgres |
24 | 1 | Aleksander Bešir | -- |
25 | 1 | Aleksander Bešir | |
26 | 1 | Aleksander Bešir | CREATE DATABASE "eneraptor-db" WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Slovenian_Slovenia.1250' LC_CTYPE = 'Slovenian_Slovenia.1250'; |
27 | 1 | Aleksander Bešir | |
28 | 1 | Aleksander Bešir | |
29 | 1 | Aleksander Bešir | ALTER DATABASE "eneraptor-db" OWNER TO postgres; |
30 | 1 | Aleksander Bešir | |
31 | 1 | Aleksander Bešir | \connect "eneraptor-db" |
32 | 1 | Aleksander Bešir | |
33 | 1 | Aleksander Bešir | SET statement_timeout = 0; |
34 | 1 | Aleksander Bešir | SET client_encoding = 'UTF8'; |
35 | 1 | Aleksander Bešir | SET standard_conforming_strings = off; |
36 | 1 | Aleksander Bešir | SET check_function_bodies = false; |
37 | 1 | Aleksander Bešir | SET client_min_messages = warning; |
38 | 1 | Aleksander Bešir | SET escape_string_warning = off; |
39 | 1 | Aleksander Bešir | |
40 | 1 | Aleksander Bešir | -- |
41 | 1 | Aleksander Bešir | -- TOC entry 1795 (class 1262 OID 16392) |
42 | 1 | Aleksander Bešir | -- Dependencies: 1794 |
43 | 1 | Aleksander Bešir | -- Name: eneraptor-db; Type: COMMENT; Schema: -; Owner: postgres |
44 | 1 | Aleksander Bešir | -- |
45 | 1 | Aleksander Bešir | |
46 | 1 | Aleksander Bešir | COMMENT ON DATABASE "eneraptor-db" IS 'Test DB for eneraptor'; |
47 | 1 | Aleksander Bešir | |
48 | 1 | Aleksander Bešir | |
49 | 1 | Aleksander Bešir | -- |
50 | 1 | Aleksander Bešir | -- TOC entry 312 (class 2612 OID 11574) |
51 | 1 | Aleksander Bešir | -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres |
52 | 1 | Aleksander Bešir | -- |
53 | 1 | Aleksander Bešir | |
54 | 1 | Aleksander Bešir | CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; |
55 | 1 | Aleksander Bešir | |
56 | 1 | Aleksander Bešir | |
57 | 1 | Aleksander Bešir | ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres; |
58 | 1 | Aleksander Bešir | |
59 | 1 | Aleksander Bešir | SET search_path = public, pg_catalog; |
60 | 1 | Aleksander Bešir | |
61 | 1 | Aleksander Bešir | -- |
62 | 1 | Aleksander Bešir | -- TOC entry 1506 (class 1259 OID 25180) |
63 | 1 | Aleksander Bešir | -- Dependencies: 5 |
64 | 1 | Aleksander Bešir | -- Name: hibernate_sequence; Type: SEQUENCE; Schema: public; Owner: eneraptor-hci |
65 | 1 | Aleksander Bešir | -- |
66 | 1 | Aleksander Bešir | |
67 | 1 | Aleksander Bešir | CREATE SEQUENCE hibernate_sequence |
68 | 1 | Aleksander Bešir | START WITH 1 |
69 | 1 | Aleksander Bešir | INCREMENT BY 1 |
70 | 1 | Aleksander Bešir | NO MINVALUE |
71 | 1 | Aleksander Bešir | NO MAXVALUE |
72 | 1 | Aleksander Bešir | CACHE 1; |
73 | 1 | Aleksander Bešir | |
74 | 1 | Aleksander Bešir | |
75 | 1 | Aleksander Bešir | ALTER TABLE public.hibernate_sequence OWNER TO "eneraptor-hci"; |
76 | 1 | Aleksander Bešir | |
77 | 1 | Aleksander Bešir | -- |
78 | 1 | Aleksander Bešir | -- TOC entry 1798 (class 0 OID 0) |
79 | 1 | Aleksander Bešir | -- Dependencies: 1506 |
80 | 1 | Aleksander Bešir | -- Name: hibernate_sequence; Type: SEQUENCE SET; Schema: public; Owner: eneraptor-hci |
81 | 1 | Aleksander Bešir | -- |
82 | 1 | Aleksander Bešir | |
83 | 1 | Aleksander Bešir | SELECT pg_catalog.setval('hibernate_sequence', 5, true); |
84 | 1 | Aleksander Bešir | |
85 | 1 | Aleksander Bešir | |
86 | 1 | Aleksander Bešir | SET default_tablespace = ''; |
87 | 1 | Aleksander Bešir | |
88 | 1 | Aleksander Bešir | SET default_with_oids = false; |
89 | 1 | Aleksander Bešir | |
90 | 1 | Aleksander Bešir | -- |
91 | 1 | Aleksander Bešir | -- TOC entry 1504 (class 1259 OID 25162) |
92 | 1 | Aleksander Bešir | -- Dependencies: 5 |
93 | 1 | Aleksander Bešir | -- Name: internal_config; Type: TABLE; Schema: public; Owner: eneraptor-hci; Tablespace: |
94 | 1 | Aleksander Bešir | -- |
95 | 1 | Aleksander Bešir | |
96 | 1 | Aleksander Bešir | CREATE TABLE internal_config ( |
97 | 1 | Aleksander Bešir | id bigint NOT NULL, |
98 | 1 | Aleksander Bešir | version bigint NOT NULL, |
99 | 1 | Aleksander Bešir | config_id character varying(255) NOT NULL, |
100 | 1 | Aleksander Bešir | config_val character varying(255) |
101 | 1 | Aleksander Bešir | ); |
102 | 1 | Aleksander Bešir | |
103 | 1 | Aleksander Bešir | |
104 | 1 | Aleksander Bešir | ALTER TABLE public.internal_config OWNER TO "eneraptor-hci"; |
105 | 1 | Aleksander Bešir | |
106 | 1 | Aleksander Bešir | -- |
107 | 1 | Aleksander Bešir | -- TOC entry 1505 (class 1259 OID 25172) |
108 | 1 | Aleksander Bešir | -- Dependencies: 5 |
109 | 1 | Aleksander Bešir | -- Name: logged_data; Type: TABLE; Schema: public; Owner: eneraptor-hci; Tablespace: |
110 | 1 | Aleksander Bešir | -- |
111 | 1 | Aleksander Bešir | |
112 | 1 | Aleksander Bešir | CREATE TABLE logged_data ( |
113 | 1 | Aleksander Bešir | id bigint NOT NULL, |
114 | 1 | Aleksander Bešir | version bigint NOT NULL, |
115 | 1 | Aleksander Bešir | date_recieved timestamp without time zone NOT NULL, |
116 | 1 | Aleksander Bešir | device_id character varying(255) NOT NULL, |
117 | 1 | Aleksander Bešir | reported_data character varying(256) NOT NULL |
118 | 1 | Aleksander Bešir | ); |
119 | 1 | Aleksander Bešir | |
120 | 1 | Aleksander Bešir | |
121 | 1 | Aleksander Bešir | ALTER TABLE public.logged_data OWNER TO "eneraptor-hci"; |
122 | 1 | Aleksander Bešir | |
123 | 1 | Aleksander Bešir | -- |
124 | 1 | Aleksander Bešir | -- TOC entry 1790 (class 0 OID 25162) |
125 | 1 | Aleksander Bešir | -- Dependencies: 1504 |
126 | 1 | Aleksander Bešir | -- Data for Name: internal_config; Type: TABLE DATA; Schema: public; Owner: eneraptor-hci |
127 | 1 | Aleksander Bešir | -- |
128 | 1 | Aleksander Bešir | |
129 | 1 | Aleksander Bešir | COPY internal_config (id, version, config_id, config_val) FROM stdin; |
130 | 1 | Aleksander Bešir | 1 0 hci-version 0.10.12.26 |
131 | 1 | Aleksander Bešir | 2 0 super-admin admin |
132 | 1 | Aleksander Bešir | 3 0 super-pass pass |
133 | 1 | Aleksander Bešir | 4 0 logic-ip 127.0.0.1 |
134 | 1 | Aleksander Bešir | 5 0 logic-port 80 |
135 | 1 | Aleksander Bešir | \. |
136 | 1 | Aleksander Bešir | |
137 | 1 | Aleksander Bešir | |
138 | 1 | Aleksander Bešir | -- |
139 | 1 | Aleksander Bešir | -- TOC entry 1791 (class 0 OID 25172) |
140 | 1 | Aleksander Bešir | -- Dependencies: 1505 |
141 | 1 | Aleksander Bešir | -- Data for Name: logged_data; Type: TABLE DATA; Schema: public; Owner: eneraptor-hci |
142 | 1 | Aleksander Bešir | -- |
143 | 1 | Aleksander Bešir | |
144 | 1 | Aleksander Bešir | COPY logged_data (id, version, date_recieved, device_id, reported_data) FROM stdin; |
145 | 1 | Aleksander Bešir | \. |
146 | 1 | Aleksander Bešir | |
147 | 1 | Aleksander Bešir | |
148 | 1 | Aleksander Bešir | -- |
149 | 1 | Aleksander Bešir | -- TOC entry 1785 (class 2606 OID 25171) |
150 | 1 | Aleksander Bešir | -- Dependencies: 1504 1504 |
151 | 1 | Aleksander Bešir | -- Name: internal_config_config_id_key; Type: CONSTRAINT; Schema: public; Owner: eneraptor-hci; Tablespace: |
152 | 1 | Aleksander Bešir | -- |
153 | 1 | Aleksander Bešir | |
154 | 1 | Aleksander Bešir | ALTER TABLE ONLY internal_config |
155 | 1 | Aleksander Bešir | ADD CONSTRAINT internal_config_config_id_key UNIQUE (config_id); |
156 | 1 | Aleksander Bešir | |
157 | 1 | Aleksander Bešir | |
158 | 1 | Aleksander Bešir | -- |
159 | 1 | Aleksander Bešir | -- TOC entry 1787 (class 2606 OID 25169) |
160 | 1 | Aleksander Bešir | -- Dependencies: 1504 1504 |
161 | 1 | Aleksander Bešir | -- Name: internal_config_pkey; Type: CONSTRAINT; Schema: public; Owner: eneraptor-hci; Tablespace: |
162 | 1 | Aleksander Bešir | -- |
163 | 1 | Aleksander Bešir | |
164 | 1 | Aleksander Bešir | ALTER TABLE ONLY internal_config |
165 | 1 | Aleksander Bešir | ADD CONSTRAINT internal_config_pkey PRIMARY KEY (id); |
166 | 1 | Aleksander Bešir | |
167 | 1 | Aleksander Bešir | |
168 | 1 | Aleksander Bešir | -- |
169 | 1 | Aleksander Bešir | -- TOC entry 1789 (class 2606 OID 25179) |
170 | 1 | Aleksander Bešir | -- Dependencies: 1505 1505 |
171 | 1 | Aleksander Bešir | -- Name: logged_data_pkey; Type: CONSTRAINT; Schema: public; Owner: eneraptor-hci; Tablespace: |
172 | 1 | Aleksander Bešir | -- |
173 | 1 | Aleksander Bešir | |
174 | 1 | Aleksander Bešir | ALTER TABLE ONLY logged_data |
175 | 1 | Aleksander Bešir | ADD CONSTRAINT logged_data_pkey PRIMARY KEY (id); |
176 | 1 | Aleksander Bešir | |
177 | 1 | Aleksander Bešir | |
178 | 1 | Aleksander Bešir | -- |
179 | 1 | Aleksander Bešir | -- TOC entry 1797 (class 0 OID 0) |
180 | 1 | Aleksander Bešir | -- Dependencies: 5 |
181 | 1 | Aleksander Bešir | -- Name: public; Type: ACL; Schema: -; Owner: postgres |
182 | 1 | Aleksander Bešir | -- |
183 | 1 | Aleksander Bešir | |
184 | 1 | Aleksander Bešir | REVOKE ALL ON SCHEMA public FROM PUBLIC; |
185 | 1 | Aleksander Bešir | REVOKE ALL ON SCHEMA public FROM postgres; |
186 | 1 | Aleksander Bešir | GRANT ALL ON SCHEMA public TO postgres; |
187 | 1 | Aleksander Bešir | GRANT ALL ON SCHEMA public TO PUBLIC; |
188 | 1 | Aleksander Bešir | |
189 | 1 | Aleksander Bešir | |
190 | 1 | Aleksander Bešir | -- Completed on 2010-12-28 12:36:33 |
191 | 1 | Aleksander Bešir | |
192 | 1 | Aleksander Bešir | -- |
193 | 1 | Aleksander Bešir | -- PostgreSQL database dump complete |
194 | 1 | Aleksander Bešir | -- |
195 | 4 | Aleksander Bešir | </code></pre> |