· 8 years ago · Feb 14, 2018, 12:32 AM
1--
2-- PostgreSQL database dump
3--
4
5SET statement_timeout = 0;
6SET lock_timeout = 0;
7SET client_encoding = 'UTF8';
8SET standard_conforming_strings = on;
9SET check_function_bodies = false;
10SET client_min_messages = warning;
11
12--
13-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
14--
15
16CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
17
18
19--
20-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
21--
22
23COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
24
25
26SET search_path = public, pg_catalog;
27
28SET default_tablespace = '';
29
30SET default_with_oids = false;
31
32--
33-- Name: businesses; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
34--
35
36CREATE TABLE businesses (
37 id bigint NOT NULL,
38 email character varying(255) NOT NULL,
39 image oid,
40 name character varying(255) NOT NULL,
41 summary character varying(255)
42);
43
44
45ALTER TABLE businesses OWNER TO postgres;
46
47--
48-- Name: hibernate_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
49--
50
51CREATE SEQUENCE hibernate_sequence
52 START WITH 1
53 INCREMENT BY 1
54 NO MINVALUE
55 NO MAXVALUE
56 CACHE 1;
57
58
59ALTER TABLE hibernate_sequence OWNER TO postgres;
60
61--
62-- Name: locations; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
63--
64
65CREATE TABLE locations (
66 id bigint NOT NULL,
67 address character varying(255) NOT NULL,
68 business_id bigint NOT NULL,
69 email character varying(255) NOT NULL,
70 number character varying(255),
71 summary character varying(255)
72);
73
74
75ALTER TABLE locations OWNER TO postgres;
76
77--
78-- Name: locations_services; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
79--
80
81CREATE TABLE locations_services (
82 location_id bigint NOT NULL,
83 service_id bigint NOT NULL
84);
85
86
87ALTER TABLE locations_services OWNER TO postgres;
88
89--
90-- Name: services; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
91--
92
93CREATE TABLE services (
94 id bigint NOT NULL,
95 business_id bigint NOT NULL,
96 name character varying(255) NOT NULL,
97 price integer NOT NULL,
98 summary character varying(255),
99 time_duration integer NOT NULL
100);
101
102
103ALTER TABLE services OWNER TO postgres;
104
105--
106-- Name: users; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
107--
108
109CREATE TABLE users (
110 id bigint NOT NULL,
111 email character varying(255) NOT NULL,
112 first_name character varying(255) NOT NULL,
113 gender character varying(255),
114 last_name character varying(255) NOT NULL,
115 number character varying(255),
116 password character varying(255) NOT NULL,
117 user_name character varying(255) NOT NULL
118);
119
120
121ALTER TABLE users OWNER TO postgres;
122
123--
124-- Name: users_businesses; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
125--
126
127CREATE TABLE users_businesses (
128 business_id bigint NOT NULL,
129 user_id bigint NOT NULL,
130 permission integer NOT NULL
131);
132
133
134ALTER TABLE users_businesses OWNER TO postgres;
135
136--
137-- Name: working_time; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
138--
139
140CREATE TABLE working_time (
141 id bigint NOT NULL,
142 begin_hour character varying(255) NOT NULL,
143 day_of_week character varying(255) NOT NULL,
144 end_hour character varying(255) NOT NULL,
145 location_id bigint NOT NULL,
146 user_id bigint NOT NULL
147);
148
149
150ALTER TABLE working_time OWNER TO postgres;
151
152--
153-- Name: businesses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
154--
155
156ALTER TABLE ONLY businesses
157 ADD CONSTRAINT businesses_pkey PRIMARY KEY (id);
158
159
160--
161-- Name: locations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
162--
163
164ALTER TABLE ONLY locations
165 ADD CONSTRAINT locations_pkey PRIMARY KEY (id);
166
167
168--
169-- Name: locations_services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
170--
171
172ALTER TABLE ONLY locations_services
173 ADD CONSTRAINT locations_services_pkey PRIMARY KEY (location_id, service_id);
174
175
176--
177-- Name: services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
178--
179
180ALTER TABLE ONLY services
181 ADD CONSTRAINT services_pkey PRIMARY KEY (id);
182
183
184--
185-- Name: users_businesses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
186--
187
188ALTER TABLE ONLY users_businesses
189 ADD CONSTRAINT users_businesses_pkey PRIMARY KEY (business_id, user_id);
190
191
192--
193-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
194--
195
196ALTER TABLE ONLY users
197 ADD CONSTRAINT users_pkey PRIMARY KEY (id);
198
199
200--
201-- Name: working_time_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
202--
203
204ALTER TABLE ONLY working_time
205 ADD CONSTRAINT working_time_pkey PRIMARY KEY (id);
206
207
208--
209-- Name: public; Type: ACL; Schema: -; Owner: postgres
210--
211
212REVOKE ALL ON SCHEMA public FROM PUBLIC;
213REVOKE ALL ON SCHEMA public FROM postgres;
214GRANT ALL ON SCHEMA public TO postgres;
215GRANT ALL ON SCHEMA public TO PUBLIC;
216
217
218--
219-- PostgreSQL database dump complete
220--