· 8 years ago · Nov 19, 2017, 03:14 PM
1--
2-- PostgreSQL database dump
3--
4​
5-- Dumped from database version 9.6.4
6-- Dumped by pg_dump version 9.6.6
7​
8SET statement_timeout = 0;
9SET lock_timeout = 0;
10SET idle_in_transaction_session_timeout = 0;
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
13SET check_function_bodies = false;
14SET client_min_messages = warning;
15SET row_security = off;
16​
17--
18-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
19--
20​
21CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
22​
23​
24--
25-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
26--
27​
28COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
29​
30​
31SET search_path = public, pg_catalog;
32​
33SET default_tablespace = '';
34​
35SET default_with_oids = false;
36​
37--
38-- Name: amis; Type: TABLE; Schema: public; Owner: -
39--
40​
41CREATE TABLE amis (
42 idamis integer NOT NULL,
43 idusers integer NOT NULL,
44 status integer NOT NULL
45);
46​
47​
48--
49-- Name: categories; Type: TABLE; Schema: public; Owner: -
50--
51​
52CREATE TABLE categories (
53 id integer NOT NULL,
54 nom character varying(50) NOT NULL
55);
56​
57​
58--
59-- Name: categories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
60--
61​
62CREATE SEQUENCE categories_id_seq
63 START WITH 1
64 INCREMENT BY 1
65 NO MINVALUE
66 NO MAXVALUE
67 CACHE 1;
68​
69​
70--
71-- Name: categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
72--
73​
74ALTER SEQUENCE categories_id_seq OWNED BY categories.id;
75​
76​
77--
78-- Name: categoriesfilms; Type: TABLE; Schema: public; Owner: -
79--
80​
81CREATE TABLE categoriesfilms (
82 idcategories integer NOT NULL,
83 idfilms integer NOT NULL
84);
85​
86​
87--
88-- Name: films; Type: TABLE; Schema: public; Owner: -
89--
90​
91CREATE TABLE films (
92 id integer NOT NULL,
93 title character varying(70) NOT NULL,
94 description text,
95 image bytea,
96 date date,
97 notemoyenne integer,
98 temps time without time zone
99);
100​
101​
102--
103-- Name: notationusers; Type: TABLE; Schema: public; Owner: -
104--
105​
106CREATE TABLE notationusers (
107 idusers integer NOT NULL,
108 idfilms integer NOT NULL,
109 note integer NOT NULL
110);
111​
112​
113--
114-- Name: notemoyenne; Type: TABLE; Schema: public; Owner: -
115--
116​
117CREATE TABLE notemoyenne (
118 idfilm integer NOT NULL,
119 note double precision NOT NULL
120);
121​
122​
123--
124-- Name: utilisateurs; Type: TABLE; Schema: public; Owner: -
125--
126​
127CREATE TABLE utilisateurs (
128 id integer NOT NULL,
129 nom character varying(50) NOT NULL,
130 prenom character varying(50) NOT NULL,
131 pseudo character varying(50) NOT NULL,
132 motdepasse character varying(255) NOT NULL,
133 email character varying(70) NOT NULL
134);
135​
136​
137--
138-- Name: utilisateurs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
139--
140​
141CREATE SEQUENCE utilisateurs_id_seq
142 START WITH 1
143 INCREMENT BY 1
144 NO MINVALUE
145 NO MAXVALUE
146 CACHE 1;
147​
148​
149--
150-- Name: utilisateurs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
151--
152​
153ALTER SEQUENCE utilisateurs_id_seq OWNED BY utilisateurs.id;
154​
155​
156--
157-- Name: categories id; Type: DEFAULT; Schema: public; Owner: -
158--
159​
160ALTER TABLE ONLY categories ALTER COLUMN id SET DEFAULT nextval('categories_id_seq'::regclass);
161​
162​
163--
164-- Name: utilisateurs id; Type: DEFAULT; Schema: public; Owner: -
165--
166​
167ALTER TABLE ONLY utilisateurs ALTER COLUMN id SET DEFAULT nextval('utilisateurs_id_seq'::regclass);
168​
169​
170--
171-- Name: amis amis_pkey; Type: CONSTRAINT; Schema: public; Owner: -
172--
173​
174ALTER TABLE ONLY amis
175 ADD CONSTRAINT amis_pkey PRIMARY KEY (idamis, idusers);
176​
177​
178--
179-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
180--
181​
182ALTER TABLE ONLY categories
183 ADD CONSTRAINT categories_pkey PRIMARY KEY (id);
184​
185​
186--
187-- Name: categoriesfilms categoriesfilms_idcategories_idfilms_pk; Type: CONSTRAINT; Schema: public; Owner: -
188--
189​
190ALTER TABLE ONLY categoriesfilms
191 ADD CONSTRAINT categoriesfilms_idcategories_idfilms_pk PRIMARY KEY (idcategories, idfilms);
192​
193​
194--
195-- Name: films films_pkey; Type: CONSTRAINT; Schema: public; Owner: -
196--
197​
198ALTER TABLE ONLY films
199 ADD CONSTRAINT films_pkey PRIMARY KEY (id);
200​
201​
202--
203-- Name: notationusers notationusers_idusers_idfilms_pk; Type: CONSTRAINT; Schema: public; Owner: -
204--
205​
206ALTER TABLE ONLY notationusers
207 ADD CONSTRAINT notationusers_idusers_idfilms_pk PRIMARY KEY (idusers, idfilms);
208​
209​
210--
211-- Name: notemoyenne notemoyenne_pkey; Type: CONSTRAINT; Schema: public; Owner: -
212--
213​
214ALTER TABLE ONLY notemoyenne
215 ADD CONSTRAINT notemoyenne_pkey PRIMARY KEY (idfilm);
216​
217​
218--
219-- Name: utilisateurs utilisateurs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
220--
221​
222ALTER TABLE ONLY utilisateurs
223 ADD CONSTRAINT utilisateurs_pkey PRIMARY KEY (id);
224​
225​
226--
227-- Name: notemoyenne_idfilm_uindex; Type: INDEX; Schema: public; Owner: -
228--
229​
230CREATE UNIQUE INDEX notemoyenne_idfilm_uindex ON notemoyenne USING btree (idfilm);
231​
232​
233--
234-- Name: utilisateurs_email_uindex; Type: INDEX; Schema: public; Owner: -
235--
236​
237CREATE UNIQUE INDEX utilisateurs_email_uindex ON utilisateurs USING btree (email);
238​
239​
240--
241-- Name: utilisateurs_pseudo_uindex; Type: INDEX; Schema: public; Owner: -
242--
243​
244CREATE UNIQUE INDEX utilisateurs_pseudo_uindex ON utilisateurs USING btree (pseudo);
245​
246​
247--
248-- Name: amis amis_utilisateurs_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
249--
250​
251ALTER TABLE ONLY amis
252 ADD CONSTRAINT amis_utilisateurs_id_fk FOREIGN KEY (idamis) REFERENCES utilisateurs(id);
253​
254​
255--
256-- Name: amis amis_utilisateurs_id_fk2; Type: FK CONSTRAINT; Schema: public; Owner: -
257--
258​
259ALTER TABLE ONLY amis
260 ADD CONSTRAINT amis_utilisateurs_id_fk2 FOREIGN KEY (idusers) REFERENCES utilisateurs(id);
261​
262​
263--
264-- Name: categoriesfilms categoriesfilms_categories_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
265--
266​
267ALTER TABLE ONLY categoriesfilms
268 ADD CONSTRAINT categoriesfilms_categories_id_fk FOREIGN KEY (idcategories) REFERENCES categories(id);
269​
270​
271--
272-- Name: categoriesfilms categoriesfilms_films_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
273--
274​
275ALTER TABLE ONLY categoriesfilms
276 ADD CONSTRAINT categoriesfilms_films_id_fk FOREIGN KEY (idfilms) REFERENCES films(id);
277​
278​
279--
280-- Name: notationusers notationusers_utilisateurs_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
281--
282​
283ALTER TABLE ONLY notationusers
284 ADD CONSTRAINT notationusers_utilisateurs_id_fk FOREIGN KEY (idusers) REFERENCES utilisateurs(id);
285​
286​
287--
288-- Name: plpgsql; Type: ACL; Schema: -; Owner: -
289--
290​
291GRANT ALL ON LANGUAGE plpgsql TO xehnxlegzoxwms;
292​
293​
294--
295-- PostgreSQL database dump complete
296--
297​