From 35275d217bbcff586c2d9ba5b195df34d2d22b56 Mon Sep 17 00:00:00 2001 From: leosw Date: Tue, 29 Jan 2019 19:33:57 +0100 Subject: [PATCH] Change SQL schema to add more hierarchy in contents: content -> localized -> version --- _ressources/sql_skeleton.sql | 471 +++++++++++++++++++++++++---------- 1 file changed, 340 insertions(+), 131 deletions(-) diff --git a/_ressources/sql_skeleton.sql b/_ressources/sql_skeleton.sql index 59b8bdf..916e9f8 100644 --- a/_ressources/sql_skeleton.sql +++ b/_ressources/sql_skeleton.sql @@ -2,10 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 10.5 --- Dumped by pg_dump version 10.5 - --- Started on 2018-10-17 20:33:22 CEST +-- Dumped from database version 11.1 +-- Dumped by pg_dump version 11.1 SET statement_timeout = 0; SET lock_timeout = 0; @@ -18,7 +16,6 @@ SET client_min_messages = warning; SET row_security = off; -- --- TOC entry 7 (class 2615 OID 17905) -- Name: topology; Type: SCHEMA; Schema: -; Owner: kabano -- @@ -28,8 +25,6 @@ CREATE SCHEMA topology; ALTER SCHEMA topology OWNER TO kabano; -- --- TOC entry 3890 (class 0 OID 0) --- Dependencies: 7 -- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: kabano -- @@ -37,24 +32,6 @@ COMMENT ON SCHEMA topology IS 'PostGIS Topology schema'; -- --- TOC entry 1 (class 3079 OID 12281) --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- TOC entry 3891 (class 0 OID 0) --- Dependencies: 1 --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - --- --- TOC entry 3 (class 3079 OID 16398) -- Name: postgis; Type: EXTENSION; Schema: -; Owner: -- @@ -62,8 +39,6 @@ CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public; -- --- TOC entry 3892 (class 0 OID 0) --- Dependencies: 3 -- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: -- @@ -71,7 +46,6 @@ COMMENT ON EXTENSION postgis IS 'PostGIS geometry, geography, and raster spatial -- --- TOC entry 2 (class 3079 OID 17906) -- Name: postgis_topology; Type: EXTENSION; Schema: -; Owner: -- @@ -79,8 +53,6 @@ CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology; -- --- TOC entry 3893 (class 0 OID 0) --- Dependencies: 2 -- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner: -- @@ -88,7 +60,6 @@ COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and fun -- --- TOC entry 2036 (class 1247 OID 18254) -- Name: content_type_enum; Type: TYPE; Schema: public; Owner: kabano -- @@ -102,7 +73,6 @@ CREATE TYPE public.content_type_enum AS ENUM ( ALTER TYPE public.content_type_enum OWNER TO kabano; -- --- TOC entry 2021 (class 1247 OID 18166) -- Name: poi_key_enum; Type: TYPE; Schema: public; Owner: kabano -- @@ -115,7 +85,6 @@ CREATE TYPE public.poi_key_enum AS ENUM ( ALTER TYPE public.poi_key_enum OWNER TO kabano; -- --- TOC entry 2007 (class 1247 OID 18088) -- Name: poi_type_enum; Type: TYPE; Schema: public; Owner: kabano -- @@ -132,7 +101,6 @@ CREATE TYPE public.poi_type_enum AS ENUM ( ALTER TYPE public.poi_type_enum OWNER TO kabano; -- --- TOC entry 2001 (class 1247 OID 18057) -- Name: user_rank_enum; Type: TYPE; Schema: public; Owner: kabano -- @@ -149,7 +117,6 @@ CREATE TYPE public.user_rank_enum AS ENUM ( ALTER TYPE public.user_rank_enum OWNER TO kabano; -- --- TOC entry 237 (class 1259 OID 18332) -- Name: content_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -168,7 +135,6 @@ SET default_tablespace = ''; SET default_with_oids = false; -- --- TOC entry 229 (class 1259 OID 18288) -- Name: content_comments; Type: TABLE; Schema: public; Owner: kabano -- @@ -189,7 +155,6 @@ CREATE TABLE public.content_comments ( ALTER TABLE public.content_comments OWNER TO kabano; -- --- TOC entry 236 (class 1259 OID 18330) -- Name: content_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -204,7 +169,6 @@ CREATE SEQUENCE public.content_contributors_sequence ALTER TABLE public.content_contributors_sequence OWNER TO kabano; -- --- TOC entry 228 (class 1259 OID 18271) -- Name: content_contributors; Type: TABLE; Schema: public; Owner: kabano -- @@ -218,7 +182,65 @@ CREATE TABLE public.content_contributors ( ALTER TABLE public.content_contributors OWNER TO kabano; -- --- TOC entry 235 (class 1259 OID 18328) +-- Name: content_locales; Type: TABLE; Schema: public; Owner: kabano +-- + +CREATE TABLE public.content_locales ( + id integer NOT NULL, + content integer NOT NULL, + locale character varying(32) NOT NULL, + author integer NOT NULL +); + + +ALTER TABLE public.content_locales OWNER TO kabano; + +-- +-- Name: content_locales_sequence; Type: SEQUENCE; Schema: public; Owner: kabano +-- + +CREATE SEQUENCE public.content_locales_sequence + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.content_locales_sequence OWNER TO kabano; + +-- +-- Name: content_versions; Type: TABLE; Schema: public; Owner: kabano +-- + +CREATE TABLE public.content_versions ( + id integer NOT NULL, + version integer DEFAULT 0 NOT NULL, + update_date timestamp without time zone NOT NULL, + is_archive boolean DEFAULT false NOT NULL, + name character varying(255), + content text, + locale integer NOT NULL +); + + +ALTER TABLE public.content_versions OWNER TO kabano; + +-- +-- Name: content_versions_sequence; Type: SEQUENCE; Schema: public; Owner: kabano +-- + +CREATE SEQUENCE public.content_versions_sequence + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.content_versions_sequence OWNER TO kabano; + +-- -- Name: contents_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -233,31 +255,22 @@ CREATE SEQUENCE public.contents_sequence ALTER TABLE public.contents_sequence OWNER TO kabano; -- --- TOC entry 227 (class 1259 OID 18230) -- Name: contents; Type: TABLE; Schema: public; Owner: kabano -- CREATE TABLE public.contents ( id integer DEFAULT nextval('public.contents_sequence'::regclass) NOT NULL, permalink character varying(255) NOT NULL, - version integer DEFAULT 0 NOT NULL, - locale character varying(32) NOT NULL, creation_date timestamp without time zone NOT NULL, - update_date timestamp without time zone NOT NULL, - author integer NOT NULL, is_public boolean DEFAULT true NOT NULL, - is_archive boolean DEFAULT false NOT NULL, is_commentable boolean DEFAULT true NOT NULL, - type public.content_type_enum NOT NULL, - name character varying(255), - content text + type public.content_type_enum NOT NULL ); ALTER TABLE public.contents OWNER TO kabano; -- --- TOC entry 221 (class 1259 OID 18067) -- Name: locales; Type: TABLE; Schema: public; Owner: kabano -- @@ -271,7 +284,6 @@ CREATE TABLE public.locales ( ALTER TABLE public.locales OWNER TO kabano; -- --- TOC entry 234 (class 1259 OID 18326) -- Name: poi_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -286,7 +298,6 @@ CREATE SEQUENCE public.poi_comments_sequence ALTER TABLE public.poi_comments_sequence OWNER TO kabano; -- --- TOC entry 226 (class 1259 OID 18203) -- Name: poi_comments; Type: TABLE; Schema: public; Owner: kabano -- @@ -308,7 +319,6 @@ CREATE TABLE public.poi_comments ( ALTER TABLE public.poi_comments OWNER TO kabano; -- --- TOC entry 233 (class 1259 OID 18324) -- Name: poi_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -323,7 +333,6 @@ CREATE SEQUENCE public.poi_contributors_sequence ALTER TABLE public.poi_contributors_sequence OWNER TO kabano; -- --- TOC entry 225 (class 1259 OID 18186) -- Name: poi_contributors; Type: TABLE; Schema: public; Owner: kabano -- @@ -337,7 +346,6 @@ CREATE TABLE public.poi_contributors ( ALTER TABLE public.poi_contributors OWNER TO kabano; -- --- TOC entry 232 (class 1259 OID 18322) -- Name: poi_localised_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -352,7 +360,6 @@ CREATE SEQUENCE public.poi_localised_sequence ALTER TABLE public.poi_localised_sequence OWNER TO kabano; -- --- TOC entry 224 (class 1259 OID 18160) -- Name: poi_localised; Type: TABLE; Schema: public; Owner: kabano -- @@ -368,7 +375,6 @@ CREATE TABLE public.poi_localised ( ALTER TABLE public.poi_localised OWNER TO kabano; -- --- TOC entry 222 (class 1259 OID 18109) -- Name: poi_sources; Type: TABLE; Schema: public; Owner: kabano -- @@ -385,7 +391,6 @@ CREATE TABLE public.poi_sources ( ALTER TABLE public.poi_sources OWNER TO kabano; -- --- TOC entry 231 (class 1259 OID 18320) -- Name: pois_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -400,7 +405,6 @@ CREATE SEQUENCE public.pois_sequence ALTER TABLE public.pois_sequence OWNER TO kabano; -- --- TOC entry 223 (class 1259 OID 18119) -- Name: pois; Type: TABLE; Schema: public; Owner: kabano -- @@ -427,7 +431,6 @@ CREATE TABLE public.pois ( ALTER TABLE public.pois OWNER TO kabano; -- --- TOC entry 230 (class 1259 OID 18317) -- Name: users_id_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- @@ -442,7 +445,6 @@ CREATE SEQUENCE public.users_id_sequence ALTER TABLE public.users_id_sequence OWNER TO kabano; -- --- TOC entry 220 (class 1259 OID 18047) -- Name: users; Type: TABLE; Schema: public; Owner: kabano -- @@ -466,16 +468,199 @@ CREATE TABLE public.users ( ALTER TABLE public.users OWNER TO kabano; -- --- TOC entry 3717 (class 2606 OID 18297) --- Name: content_comments content_comments_permalink_version_key; Type: CONSTRAINT; Schema: public; Owner: kabano +-- Data for Name: content_comments; Type: TABLE DATA; Schema: public; Owner: kabano -- -ALTER TABLE ONLY public.content_comments - ADD CONSTRAINT content_comments_permalink_version_key UNIQUE (permalink, version); +COPY public.content_comments (id, version, creation_date, update_date, author, is_public, is_archive, content, comment, locale) FROM stdin; +\. + + +-- +-- Data for Name: content_contributors; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.content_contributors (id, content, contributor) FROM stdin; +\. + + +-- +-- Data for Name: content_locales; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.content_locales (id, content, locale, author) FROM stdin; +\. + + +-- +-- Data for Name: content_versions; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.content_versions (id, version, update_date, is_archive, name, content, locale) FROM stdin; +\. + + +-- +-- Data for Name: contents; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.contents (id, permalink, creation_date, is_public, is_commentable, type) FROM stdin; +\. + + +-- +-- Data for Name: locales; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.locales (name, display_name, flag_name) FROM stdin; +fr_FR Français fr +\. + + +-- +-- Data for Name: poi_comments; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.poi_comments (id, permalink, version, creation_date, update_date, author, is_public, is_archive, poi, comment, locale) FROM stdin; +\. + + +-- +-- Data for Name: poi_contributors; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.poi_contributors (id, poi, contributor) FROM stdin; +\. + + +-- +-- Data for Name: poi_localised; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.poi_localised (id, poi, locale, key, value) FROM stdin; +\. + + +-- +-- Data for Name: poi_sources; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.poi_sources (id, display_name, icon_name, website, license_name, license_url) FROM stdin; +\. + + +-- +-- Data for Name: pois; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.pois (id, permalink, version, creation_date, update_date, author, is_public, is_archive, type, is_detroyed, name, alt_names, source, source_id, "position", parameters) FROM stdin; +\. + + +-- +-- Data for Name: spatial_ref_sys; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin; +\. + + +-- +-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: kabano +-- + +COPY public.users (id, name, version, email, password, website, is_avatar_present, is_archive, rank, locale, timezone, visit_date, register_date) FROM stdin; +4 leosw2 0 leo@leo.fr b36982d19ecde5eabbd83f964c6fe560050fe4bd f f moderator fr_FR CEST 2018-11-04 07:12:11 2018-10-17 18:14:11 +1 leosw 1 leo@lstronic.com b36982d19ecde5eabbd83f964c6fe560050fe4bd https://lstronic.com t f administrator fr_FR CEST 2019-01-29 18:23:39 2018-09-03 21:27:13 +\. + + +-- +-- Data for Name: topology; Type: TABLE DATA; Schema: topology; Owner: kabano +-- + +COPY topology.topology (id, name, srid, "precision", hasz) FROM stdin; +\. + + +-- +-- Data for Name: layer; Type: TABLE DATA; Schema: topology; Owner: kabano +-- + +COPY topology.layer (topology_id, layer_id, schema_name, table_name, feature_column, feature_type, level, child_id) FROM stdin; +\. + + +-- +-- Name: content_comments_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.content_comments_sequence', 3, true); + + +-- +-- Name: content_contributors_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.content_contributors_sequence', 30, true); + + +-- +-- Name: content_locales_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.content_locales_sequence', 1, false); + + +-- +-- Name: content_versions_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.content_versions_sequence', 1, false); + + +-- +-- Name: contents_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.contents_sequence', 26, true); + + +-- +-- Name: poi_comments_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.poi_comments_sequence', 1, false); + + +-- +-- Name: poi_contributors_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.poi_contributors_sequence', 1, false); + + +-- +-- Name: poi_localised_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.poi_localised_sequence', 1, false); + + +-- +-- Name: pois_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.pois_sequence', 1, false); + + +-- +-- Name: users_id_sequence; Type: SEQUENCE SET; Schema: public; Owner: kabano +-- + +SELECT pg_catalog.setval('public.users_id_sequence', 4, true); -- --- TOC entry 3719 (class 2606 OID 18295) -- Name: content_comments content_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -484,7 +669,6 @@ ALTER TABLE ONLY public.content_comments -- --- TOC entry 3711 (class 2606 OID 18275) -- Name: content_contributors content_contributors_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -493,7 +677,6 @@ ALTER TABLE ONLY public.content_contributors -- --- TOC entry 3713 (class 2606 OID 18277) -- Name: content_contributors content_contributors_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -502,16 +685,46 @@ ALTER TABLE ONLY public.content_contributors -- --- TOC entry 3707 (class 2606 OID 18262) --- Name: contents contents_permalink_unique; Type: CONSTRAINT; Schema: public; Owner: kabano +-- Name: content_locales content_locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_locales + ADD CONSTRAINT content_locales_pkey PRIMARY KEY (id); + + +-- +-- Name: content_locales content_locales_unique; Type: CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_locales + ADD CONSTRAINT content_locales_unique UNIQUE (content, locale); + + +-- +-- Name: content_versions content_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_versions + ADD CONSTRAINT content_versions_pkey PRIMARY KEY (id); + + +-- +-- Name: content_versions content_versions_version_locale_key; Type: CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_versions + ADD CONSTRAINT content_versions_version_locale_key UNIQUE (version, locale); + + +-- +-- Name: contents contents_permalink_type_key; Type: CONSTRAINT; Schema: public; Owner: kabano -- ALTER TABLE ONLY public.contents - ADD CONSTRAINT contents_permalink_unique UNIQUE (permalink, version, locale); + ADD CONSTRAINT contents_permalink_type_key UNIQUE (permalink, type); -- --- TOC entry 3709 (class 2606 OID 18238) -- Name: contents contents_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -520,7 +733,6 @@ ALTER TABLE ONLY public.contents -- --- TOC entry 3673 (class 2606 OID 18073) -- Name: locales locales_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -529,7 +741,6 @@ ALTER TABLE ONLY public.locales -- --- TOC entry 3675 (class 2606 OID 18075) -- Name: locales locales_flag_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -538,7 +749,6 @@ ALTER TABLE ONLY public.locales -- --- TOC entry 3677 (class 2606 OID 18071) -- Name: locales locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -547,7 +757,6 @@ ALTER TABLE ONLY public.locales -- --- TOC entry 3701 (class 2606 OID 18212) -- Name: poi_comments poi_comments_permalink_version_key; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -556,7 +765,6 @@ ALTER TABLE ONLY public.poi_comments -- --- TOC entry 3703 (class 2606 OID 18210) -- Name: poi_comments poi_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -565,7 +773,6 @@ ALTER TABLE ONLY public.poi_comments -- --- TOC entry 3695 (class 2606 OID 18190) -- Name: poi_contributors poi_contributors_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -574,7 +781,6 @@ ALTER TABLE ONLY public.poi_contributors -- --- TOC entry 3697 (class 2606 OID 18192) -- Name: poi_contributors poi_contributors_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -583,7 +789,6 @@ ALTER TABLE ONLY public.poi_contributors -- --- TOC entry 3691 (class 2606 OID 18164) -- Name: poi_localised poi_localised_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -592,7 +797,6 @@ ALTER TABLE ONLY public.poi_localised -- --- TOC entry 3693 (class 2606 OID 18185) -- Name: poi_localised poi_localised_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -601,7 +805,6 @@ ALTER TABLE ONLY public.poi_localised -- --- TOC entry 3679 (class 2606 OID 18118) -- Name: poi_sources poi_sources_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -610,7 +813,6 @@ ALTER TABLE ONLY public.poi_sources -- --- TOC entry 3681 (class 2606 OID 18116) -- Name: poi_sources poi_sources_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -619,7 +821,6 @@ ALTER TABLE ONLY public.poi_sources -- --- TOC entry 3686 (class 2606 OID 18145) -- Name: pois pois_permalink_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -628,7 +829,6 @@ ALTER TABLE ONLY public.pois -- --- TOC entry 3688 (class 2606 OID 18124) -- Name: pois pois_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -637,7 +837,6 @@ ALTER TABLE ONLY public.pois -- --- TOC entry 3665 (class 2606 OID 18079) -- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -646,7 +845,6 @@ ALTER TABLE ONLY public.users -- --- TOC entry 3668 (class 2606 OID 18077) -- Name: users users_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -655,7 +853,6 @@ ALTER TABLE ONLY public.users -- --- TOC entry 3670 (class 2606 OID 18055) -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- @@ -664,7 +861,6 @@ ALTER TABLE ONLY public.users -- --- TOC entry 3714 (class 1259 OID 18313) -- Name: content_comments_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -672,7 +868,6 @@ CREATE INDEX content_comments_is_archive_index ON public.content_comments USING -- --- TOC entry 3715 (class 1259 OID 18314) -- Name: content_comments_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -680,15 +875,6 @@ CREATE INDEX content_comments_is_public_index ON public.content_comments USING b -- --- TOC entry 3704 (class 1259 OID 18251) --- Name: contents_is_archive_index; Type: INDEX; Schema: public; Owner: kabano --- - -CREATE INDEX contents_is_archive_index ON public.contents USING btree (is_archive); - - --- --- TOC entry 3705 (class 1259 OID 18252) -- Name: contents_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -696,7 +882,20 @@ CREATE INDEX contents_is_public_index ON public.contents USING btree (is_public) -- --- TOC entry 3698 (class 1259 OID 18229) +-- Name: fki_content_contributors_content_fkey; Type: INDEX; Schema: public; Owner: kabano +-- + +CREATE INDEX fki_content_contributors_content_fkey ON public.content_contributors USING btree (content); + + +-- +-- Name: fki_content_contributors_contributor_fkey; Type: INDEX; Schema: public; Owner: kabano +-- + +CREATE INDEX fki_content_contributors_contributor_fkey ON public.content_contributors USING btree (contributor); + + +-- -- Name: poi_comments_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -704,7 +903,6 @@ CREATE INDEX poi_comments_is_archive_index ON public.poi_comments USING btree (i -- --- TOC entry 3699 (class 1259 OID 18228) -- Name: poi_comments_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -712,7 +910,6 @@ CREATE INDEX poi_comments_is_public_index ON public.poi_comments USING btree (is -- --- TOC entry 3682 (class 1259 OID 18157) -- Name: pois_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -720,7 +917,6 @@ CREATE INDEX pois_is_archive_index ON public.pois USING btree (is_archive); -- --- TOC entry 3683 (class 1259 OID 18159) -- Name: pois_is_destroyed_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -728,7 +924,6 @@ CREATE INDEX pois_is_destroyed_index ON public.pois USING btree (is_detroyed); -- --- TOC entry 3684 (class 1259 OID 18156) -- Name: pois_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -736,7 +931,6 @@ CREATE INDEX pois_is_public_index ON public.pois USING btree (is_public); -- --- TOC entry 3689 (class 1259 OID 18158) -- Name: pois_type_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -744,7 +938,6 @@ CREATE INDEX pois_type_index ON public.pois USING btree (type); -- --- TOC entry 3666 (class 1259 OID 18080) -- Name: users_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -752,7 +945,6 @@ CREATE INDEX users_is_archive_index ON public.users USING btree (is_archive); -- --- TOC entry 3671 (class 1259 OID 18081) -- Name: users_register_date_index; Type: INDEX; Schema: public; Owner: kabano -- @@ -760,7 +952,6 @@ CREATE INDEX users_register_date_index ON public.users USING btree (register_dat -- --- TOC entry 3734 (class 2606 OID 18298) -- Name: content_comments content_comments_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -769,7 +960,6 @@ ALTER TABLE ONLY public.content_comments -- --- TOC entry 3736 (class 2606 OID 18308) -- Name: content_comments content_comments_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -778,7 +968,6 @@ ALTER TABLE ONLY public.content_comments -- --- TOC entry 3735 (class 2606 OID 18303) -- Name: content_comments content_comments_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -787,16 +976,14 @@ ALTER TABLE ONLY public.content_comments -- --- TOC entry 3733 (class 2606 OID 18283) -- Name: content_contributors content_contributors_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- ALTER TABLE ONLY public.content_contributors - ADD CONSTRAINT content_contributors_content_fkey FOREIGN KEY (content) REFERENCES public.contents(id); + ADD CONSTRAINT content_contributors_content_fkey FOREIGN KEY (content) REFERENCES public.content_locales(id); -- --- TOC entry 3732 (class 2606 OID 18278) -- Name: content_contributors content_contributors_contributor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -805,25 +992,38 @@ ALTER TABLE ONLY public.content_contributors -- --- TOC entry 3730 (class 2606 OID 18241) --- Name: contents contents_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano +-- Name: content_locales content_locales_author; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- -ALTER TABLE ONLY public.contents - ADD CONSTRAINT contents_author_fkey FOREIGN KEY (author) REFERENCES public.users(id); +ALTER TABLE ONLY public.content_locales + ADD CONSTRAINT content_locales_author FOREIGN KEY (author) REFERENCES public.users(id); -- --- TOC entry 3731 (class 2606 OID 18263) --- Name: contents contents_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano +-- Name: content_locales content_locales_content; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- -ALTER TABLE ONLY public.contents - ADD CONSTRAINT contents_locale_fkey FOREIGN KEY (locale) REFERENCES public.locales(name); +ALTER TABLE ONLY public.content_locales + ADD CONSTRAINT content_locales_content FOREIGN KEY (content) REFERENCES public.contents(id); + + +-- +-- Name: content_locales content_locales_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_locales + ADD CONSTRAINT content_locales_locale FOREIGN KEY (locale) REFERENCES public.locales(name); + + +-- +-- Name: content_versions content_versions_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano +-- + +ALTER TABLE ONLY public.content_versions + ADD CONSTRAINT content_versions_locale FOREIGN KEY (locale) REFERENCES public.content_locales(id); -- --- TOC entry 3727 (class 2606 OID 18213) -- Name: poi_comments poi_comments_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -832,7 +1032,6 @@ ALTER TABLE ONLY public.poi_comments -- --- TOC entry 3728 (class 2606 OID 18218) -- Name: poi_comments poi_comments_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -841,7 +1040,6 @@ ALTER TABLE ONLY public.poi_comments -- --- TOC entry 3729 (class 2606 OID 18223) -- Name: poi_comments poi_comments_poi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -850,7 +1048,6 @@ ALTER TABLE ONLY public.poi_comments -- --- TOC entry 3725 (class 2606 OID 18193) -- Name: poi_contributors poi_contributors_contributor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -859,7 +1056,6 @@ ALTER TABLE ONLY public.poi_contributors -- --- TOC entry 3726 (class 2606 OID 18198) -- Name: poi_contributors poi_contributors_poi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -868,7 +1064,6 @@ ALTER TABLE ONLY public.poi_contributors -- --- TOC entry 3724 (class 2606 OID 18179) -- Name: poi_localised poi_localised_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -877,7 +1072,6 @@ ALTER TABLE ONLY public.poi_localised -- --- TOC entry 3723 (class 2606 OID 18174) -- Name: poi_localised poi_localised_poi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -886,7 +1080,6 @@ ALTER TABLE ONLY public.poi_localised -- --- TOC entry 3721 (class 2606 OID 18146) -- Name: pois pois_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -895,7 +1088,6 @@ ALTER TABLE ONLY public.pois -- --- TOC entry 3722 (class 2606 OID 18151) -- Name: pois pois_source_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -904,7 +1096,6 @@ ALTER TABLE ONLY public.pois -- --- TOC entry 3720 (class 2606 OID 18082) -- Name: users users_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- @@ -912,7 +1103,25 @@ ALTER TABLE ONLY public.users ADD CONSTRAINT users_locale_fkey FOREIGN KEY (locale) REFERENCES public.locales(name); --- Completed on 2018-10-17 20:33:23 CEST +-- +-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: kabano +-- + +REVOKE ALL ON SCHEMA public FROM postgres; +REVOKE ALL ON SCHEMA public FROM PUBLIC; +GRANT ALL ON SCHEMA public TO PUBLIC; +GRANT ALL ON SCHEMA public TO kabano; + + +-- +-- Name: TABLE spatial_ref_sys; Type: ACL; Schema: public; Owner: kabano +-- + +REVOKE ALL ON TABLE public.spatial_ref_sys FROM postgres; +REVOKE SELECT ON TABLE public.spatial_ref_sys FROM PUBLIC; +GRANT ALL ON TABLE public.spatial_ref_sys TO kabano; +GRANT SELECT ON TABLE public.spatial_ref_sys TO PUBLIC; + -- -- PostgreSQL database dump complete