Changement du modèle SQL : le contenu de content_version est désormais en json (pour pouvoir recevoir les POI), et on a créé la base pour la géométrie à venir des POIs

This commit is contained in:
leosw
2026-01-18 12:10:39 +01:00
parent 49e83aef49
commit 7d39b5295a
6 changed files with 273 additions and 1240 deletions

View File

@@ -1,116 +0,0 @@
# Database structure for kabano.org open-source project
# This file is designed to be imported in quickdatabasediagrams.com
locales
-
name PK varchar(32)
display_name UNIQUE varchar(255)
flag_name UNIQUE NULL varchar(32)
users
-
id PK int4
name UNIQUE varchar(255) # The unique constraint is done with version
version UNIQUE int4 # The unique constraint is done with name
email UNIQUE varchar(255)
password varchar(255)
website NULL varchar(255)
is_avatar_present boolean
is_archive INDEX boolean
rank user_rank_enum # blocked; registered; premium; moderator; admin
locale varchar(32) FK >- locales.name
timezone varchar(8)
visit_date timestamp
register_date INDEX timestamp
pois
-
id PK int4
permalink UNIQUE varchar(255) # The unique constraint is done with version
version UNIQUE int4 # The unique constraint is done with permalink
creation_date timestamp
update_date timestamp
author int4 FK >- users.id
is_public INDEX boolean
is_archive INDEX boolean
type INDEX poi_type_enum # basic_hut; wilderness_hut; alpine_hut; halt; bivouac; campsite
is_destroyed INDEX boolean
name varchar(255)
alt_names NULL varchar(255)
source NULL varchar(3) FK >- poi_sources.id
source_id NULL varchar(255)
position geometry # Contains elevation data
parameters NULL jsonb
poi_localised
-
id PK int4
poi UNIQUE int4 FK >- pois.id # The unique constraint is done with locale, key
locale UNIQUE varchar(32) FK >- locales.name # The unique constraint is done with poi, key
key UNIQUE poi_key_enum # description; access # The unique constraint is done with poi, locale
value text
poi_sources
-
id PK varchar(3)
display_name UNIQUE varchar(255)
icon_name NULL varchar(255)
website NULL varchar(255)
license_name NULL varchar(255)
license_url NULL varchar(255)
poi_contributors
-
id PK int4
poi UNIQUE int4 FK >- pois.id # The unique constraint is done with contributor
contributor UNIQUE int4 FK >- users.id # The unique constraint is done with poi
poi_comments
-
id PK int4
permalink UNIQUE varchar(255) # The unique constraint is done with version
version UNIQUE int4 # The unique constraint is done with permalink
creation_date timestamp
update_date timestamp
author int4 FK >- users.id
is_public INDEX boolean
is_archive INDEX boolean
poi int4 FK >- pois.id
comment text
locale varchar(32) FK >- locales.name
contents
-
id PK int4
permalink UNIQUE varchar(255) # The unique constraint is done with version and locale
version UNIQUE int4 # The unique constraint is done with permalink and locale
locale UNIQUE varchar(32) FK >- locales.name # The unique constraint is done with permalink and version
creation_date timestamp
update_date timestamp
author int4 FK >- users.id
is_public INDEX boolean
is_archive INDEX boolean
is_commentable boolean
type INDEX content_type_enum # wiki, blog, forum
name varchar(255)
content text
content_contributors
-
id PK int4
content UNIQUE int4 FK >- contents.id # The unique constraint is done with contributor
contributor UNIQUE int4 FK >- users.id # The unique constraint is done with content
content_comments
-
id PK int4
permalink UNIQUE varchar(255) # The unique constraint is done with version
version UNIQUE int4 # The unique constraint is done with permalink
creation_date timestamp
update_date timestamp
author int4 FK >- users.id
is_public INDEX boolean
is_archive INDEX boolean
content int4 FK >- contents.id
comment text
locale varchar(32) FK >- locales.name

View File

@@ -1,882 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
CAUTION: Do not modify this file unless you know what you are doing.
Unexpected results may occur if the code is changed deliberately.
-->
<dbmodel pgmodeler-ver="0.9.2-alpha1" last-position="0,998" last-zoom="0.9" max-obj-count="24"
default-owner="postgres">
<role name="kabano"
inherit="true"
login="true"
encrypted="true"
password="********">
</role>
<database name="kabano" encoding="UTF8" lc-collate="fr_FR.UTF-8" lc-ctype="fr_FR.UTF-8" is-template="false" allow-conns="true">
<role name="kabano"/>
<tablespace name="pg_default"/>
</database>
<schema name="public" layer="0" rect-visible="true" fill-color="#e1e1e1" sql-disabled="true">
</schema>
<schema name="topology" layer="0" rect-visible="true" fill-color="#c8e6ff">
<role name="kabano"/>
<comment><![CDATA[PostGIS Topology schema]]></comment>
</schema>
<extension name="postgis" cur-version="2.5.1">
<schema name="public"/>
<comment><![CDATA[PostGIS geometry, geography, and raster spatial types and functions]]></comment>
</extension>
<extension name="postgis_topology" cur-version="2.5.1">
<schema name="topology"/>
<comment><![CDATA[PostGIS topology spatial types and functions]]></comment>
</extension>
<usertype name="content_type_enum" configuration="enumeration">
<schema name="public"/>
<role name="kabano"/>
<enumeration values="wiki,blog,forum"/>
</usertype>
<usertype name="poi_type_enum" configuration="enumeration">
<schema name="public"/>
<role name="kabano"/>
<enumeration values="basic_hut,wilderness_hut,alpine_hut,halt,bivouac,campsite"/>
</usertype>
<usertype name="user_rank_enum" configuration="enumeration">
<schema name="public"/>
<role name="kabano"/>
<enumeration values="blocked,registered,premium,moderator,administrator,visitor"/>
</usertype>
<sequence name="content_comments_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="content_comments" layer="0" collapse-mode="2" max-obj-count="12">
<schema name="public"/>
<role name="kabano"/>
<position x="540" y="340"/>
<column name="id" not-null="true" sequence="public.content_comments_sequence">
<type name="integer" length="0"/>
</column>
<column name="version">
<type name="integer" length="0"/>
</column>
<column name="creation_date">
<type name="timestamp" length="0"/>
</column>
<column name="update_date">
<type name="timestamp" length="0"/>
</column>
<column name="author">
<type name="integer" length="0"/>
</column>
<column name="is_public">
<type name="boolean" length="0"/>
</column>
<column name="is_archive">
<type name="boolean" length="0"/>
</column>
<column name="content">
<type name="integer" length="0"/>
</column>
<column name="comment">
<type name="text" length="0"/>
</column>
<column name="locale">
<type name="character varying" length="32"/>
</column>
<constraint name="content_comments_pkey" type="pk-constr" table="public.content_comments">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="content_contributors_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="content_contributors" layer="0" collapse-mode="2" max-obj-count="4">
<schema name="public"/>
<role name="kabano"/>
<position x="1460" y="300"/>
<column name="id" not-null="true" sequence="public.content_contributors_sequence">
<type name="integer" length="0"/>
</column>
<column name="content">
<type name="integer" length="0"/>
</column>
<column name="contributor">
<type name="integer" length="0"/>
</column>
<constraint name="content_contributors_pkey" type="pk-constr" table="public.content_contributors">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="content_contributors_unique" type="uq-constr" table="public.content_contributors">
<columns names="content,contributor" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="contents_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="contents" layer="0" collapse-mode="2" max-obj-count="7">
<schema name="public"/>
<role name="kabano"/>
<position x="540" y="60"/>
<column name="id" not-null="true" sequence="public.contents_sequence">
<type name="integer" length="0"/>
</column>
<column name="permalink" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="creation_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="is_public" not-null="true" default-value="true">
<type name="boolean" length="0"/>
</column>
<column name="is_commentable" not-null="true" default-value="true">
<type name="boolean" length="0"/>
</column>
<column name="type" not-null="true">
<type name="public.content_type_enum" length="0"/>
</column>
<constraint name="contents_pkey" type="pk-constr" table="public.contents">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="contents_permalink_type_key" type="uq-constr" table="public.contents">
<columns names="permalink,type" ref-type="src-columns"/>
</constraint>
</table>
<table name="locales" layer="0" collapse-mode="2" max-obj-count="3">
<schema name="public"/>
<role name="kabano"/>
<position x="700" y="800"/>
<column name="name" not-null="true">
<type name="character varying" length="32"/>
</column>
<column name="display_name" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="flag_name">
<type name="character varying" length="32"/>
</column>
<constraint name="locales_display_name_unique" type="uq-constr" table="public.locales">
<columns names="display_name" ref-type="src-columns"/>
</constraint>
<constraint name="locales_flag_name_unique" type="uq-constr" table="public.locales">
<columns names="flag_name" ref-type="src-columns"/>
</constraint>
<constraint name="locales_pkey" type="pk-constr" table="public.locales">
<columns names="name" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="poi_comments_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="poi_comments" layer="0" collapse-mode="2" max-obj-count="13">
<schema name="public"/>
<role name="kabano"/>
<position x="1100" y="980"/>
<column name="id" not-null="true" sequence="public.poi_comments_sequence">
<type name="integer" length="0"/>
</column>
<column name="permalink">
<type name="character varying" length="255"/>
</column>
<column name="version">
<type name="integer" length="0"/>
</column>
<column name="creation_date">
<type name="timestamp" length="0"/>
</column>
<column name="update_date">
<type name="timestamp" length="0"/>
</column>
<column name="author">
<type name="integer" length="0"/>
</column>
<column name="is_public">
<type name="boolean" length="0"/>
</column>
<column name="is_archive">
<type name="boolean" length="0"/>
</column>
<column name="poi">
<type name="integer" length="0"/>
</column>
<column name="comment">
<type name="text" length="0"/>
</column>
<column name="locale">
<type name="character varying" length="32"/>
</column>
<constraint name="poi_comments_permalink_version_key" type="uq-constr" table="public.poi_comments">
<columns names="permalink,version" ref-type="src-columns"/>
</constraint>
<constraint name="poi_comments_pkey" type="pk-constr" table="public.poi_comments">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="poi_contributors_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="poi_contributors" layer="0" collapse-mode="2" max-obj-count="4">
<schema name="public"/>
<role name="kabano"/>
<position x="1560" y="820"/>
<column name="id" not-null="true" sequence="public.poi_contributors_sequence">
<type name="integer" length="0"/>
</column>
<column name="poi">
<type name="integer" length="0"/>
</column>
<column name="contributor">
<type name="integer" length="0"/>
</column>
<constraint name="poi_contributors_pkey" type="pk-constr" table="public.poi_contributors">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="poi_contributors_unique" type="uq-constr" table="public.poi_contributors">
<columns names="poi,contributor" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="poi_locales_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="poi_locales" layer="0" collapse-mode="2" max-obj-count="4">
<schema name="public"/>
<role name="kabano"/>
<position x="720" y="1340"/>
<column name="id" not-null="true" default-value="nextval('poi_locales_sequence'::regclass)">
<type name="integer" length="0"/>
</column>
<column name="locale" not-null="true">
<type name="character varying" length="32"/>
</column>
<column name="poi_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="poi_localised_pkey" type="pk-constr" table="public.poi_locales">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="poi_localised_unique" type="uq-constr" table="public.poi_locales">
<columns names="locale,poi_id" ref-type="src-columns"/>
</constraint>
</table>
<table name="sources" layer="0" collapse-mode="2" max-obj-count="7">
<schema name="public"/>
<role name="kabano"/>
<position x="1160" y="1660"/>
<column name="id" not-null="true">
<type name="character varying" length="3"/>
</column>
<column name="display_name" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="icon_name">
<type name="character varying" length="255"/>
</column>
<column name="website">
<type name="character varying" length="255"/>
</column>
<column name="license_name">
<type name="character varying" length="255"/>
</column>
<column name="license_url">
<type name="character varying" length="255"/>
</column>
<constraint name="sources_display_name_unique" type="uq-constr" table="public.sources">
<columns names="display_name" ref-type="src-columns"/>
</constraint>
<constraint name="sources_pkey" type="pk-constr" table="public.sources">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="poi_versions_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<sequence name="pois_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<sequence name="users_id_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="users" layer="0" collapse-mode="2" max-obj-count="15">
<schema name="public"/>
<role name="kabano"/>
<position x="1140" y="540"/>
<column name="id" not-null="true" sequence="public.users_id_sequence">
<type name="integer" length="0"/>
</column>
<column name="name" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="version" not-null="true" default-value="0">
<type name="integer" length="0"/>
</column>
<column name="email" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="password" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="website">
<type name="character varying" length="255"/>
</column>
<column name="is_avatar_present" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="is_archive" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="rank" not-null="true">
<type name="public.user_rank_enum" length="0"/>
</column>
<column name="locale" not-null="true">
<type name="character varying" length="32"/>
</column>
<column name="timezone" not-null="true">
<type name="character varying" length="8"/>
</column>
<column name="visit_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="register_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<constraint name="users_email_unique" type="uq-constr" table="public.users">
<columns names="email" ref-type="src-columns"/>
</constraint>
<constraint name="users_name_unique" type="uq-constr" table="public.users">
<columns names="name,version" ref-type="src-columns"/>
</constraint>
<constraint name="users_pkey" type="pk-constr" table="public.users">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<index name="content_comments_is_archive_index" table="public.content_comments"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_archive"/>
</idxelement>
</index>
<index name="content_comments_is_public_index" table="public.content_comments"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_public"/>
</idxelement>
</index>
<index name="contents_is_public_index" table="public.contents"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_public"/>
</idxelement>
</index>
<index name="poi_comments_is_archive_index" table="public.poi_comments"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_archive"/>
</idxelement>
</index>
<index name="poi_comments_is_public_index" table="public.poi_comments"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_public"/>
</idxelement>
</index>
<index name="users_is_archive_index" table="public.users"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_archive"/>
</idxelement>
</index>
<index name="users_register_date_index" table="public.users"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="register_date"/>
</idxelement>
</index>
<sequence name="content_locales_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<sequence name="content_versions_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<index name="fki_content_contributors_contributor_fkey" table="public.content_contributors"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="contributor"/>
</idxelement>
</index>
<index name="fki_content_contributors_content_fkey" table="public.content_contributors"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="content"/>
</idxelement>
</index>
<table name="content_locales" layer="0" collapse-mode="2" max-obj-count="6">
<schema name="public"/>
<role name="kabano"/>
<position x="1020" y="60"/>
<column name="id" not-null="true" sequence="public.content_locales_sequence">
<type name="integer" length="0"/>
</column>
<column name="content_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="locale" not-null="true">
<type name="character varying" length="32"/>
</column>
<column name="author" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="content_locales_pkey" type="pk-constr" table="public.content_locales">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="content_locales_unique" type="uq-constr" table="public.content_locales">
<columns names="content_id,locale" ref-type="src-columns"/>
</constraint>
</table>
<table name="content_versions" layer="0" collapse-mode="2" max-obj-count="8">
<schema name="public"/>
<role name="kabano"/>
<position x="1500" y="40"/>
<column name="id" not-null="true" sequence="public.content_versions_sequence">
<type name="integer" length="0"/>
</column>
<column name="version" not-null="true" default-value="0">
<type name="integer" length="0"/>
</column>
<column name="update_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="is_archive" not-null="true" default-value="false">
<type name="boolean" length="0"/>
</column>
<column name="name">
<type name="character varying" length="255"/>
</column>
<column name="content">
<type name="text" length="0"/>
</column>
<column name="locale_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="content_versions_pkey" type="pk-constr" table="public.content_versions">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="content_versions_version_locale_key" type="uq-constr" table="public.content_versions">
<columns names="version,locale_id" ref-type="src-columns"/>
</constraint>
</table>
<table name="pois" layer="0" collapse-mode="2" max-obj-count="8">
<schema name="public"/>
<role name="kabano"/>
<position x="300" y="1340"/>
<column name="id" not-null="true" sequence="public.poi_versions_sequence">
<type name="integer" length="0"/>
</column>
<column name="is_public" not-null="true" default-value="true">
<type name="boolean" length="0"/>
</column>
<column name="permalink" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="creation_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="name" not-null="true">
<type name="character varying" length="255"/>
</column>
<column name="position" not-null="true">
<type name="geometry" length="0"/>
</column>
<column name="type" not-null="true">
<type name="public.poi_type_enum" length="0"/>
</column>
<constraint name="pois_pkey" type="pk-constr" table="public.pois">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="pois_permalink_key" type="uq-constr" table="public.pois">
<columns names="permalink" ref-type="src-columns"/>
</constraint>
<constraint name="pois_position_type_key" type="uq-constr" table="public.pois">
<columns names="position,type" ref-type="src-columns"/>
</constraint>
</table>
<table name="poi_versions" layer="0" collapse-mode="2" max-obj-count="12">
<schema name="public"/>
<role name="kabano"/>
<position x="1620" y="1260"/>
<column name="id" not-null="true" sequence="public.pois_sequence">
<type name="integer" length="0"/>
</column>
<column name="version" not-null="true" default-value="0">
<type name="integer" length="0"/>
</column>
<column name="update_date" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="is_archive" not-null="true" default-value="false">
<type name="boolean" length="0"/>
</column>
<column name="alt_type" not-null="true">
<type name="public.poi_type_enum" length="0"/>
</column>
<column name="is_destroyed" not-null="true" default-value="false">
<type name="boolean" length="0"/>
</column>
<column name="alt_name">
<type name="character varying" length="255"/>
</column>
<column name="alt_position" not-null="true">
<type name="geometry" length="0"/>
</column>
<column name="parameters">
<type name="jsonb" length="0"/>
</column>
<column name="source_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="poi_versions_pkey" type="pk-constr" table="public.poi_versions">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="poi_versions_version_source_key" type="uq-constr" table="public.poi_versions">
<columns names="version,source_id" ref-type="src-columns"/>
</constraint>
</table>
<index name="poi_versions_is_archive_index" table="public.poi_versions"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_archive"/>
</idxelement>
</index>
<index name="poi_versions_is_destroyed_index" table="public.poi_versions"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="is_destroyed"/>
</idxelement>
</index>
<index name="poi_versions_type_index" table="public.poi_versions"
concurrent="false" unique="false" fast-update="false" buffering="false"
index-type="btree" factor="90">
<idxelement use-sorting="false">
<column name="alt_type"/>
</idxelement>
</index>
<sequence name="poi_sources_sequence" cycle="false" start="1" increment="1" min-value="1" max-value="9223372036854775807" cache="1">
<schema name="public"/>
<role name="kabano"/>
</sequence>
<table name="poi_sources" layer="0" collapse-mode="2" max-obj-count="6">
<schema name="public"/>
<role name="kabano"/>
<position x="1160" y="1400"/>
<column name="id" not-null="true" sequence="public.poi_sources_sequence">
<type name="integer" length="0"/>
</column>
<column name="source">
<type name="character varying" length="3"/>
</column>
<column name="remote_source_id">
<type name="character varying" length="255"/>
</column>
<column name="author" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="locale_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="poi_sources_pkey" type="pk-constr" table="public.poi_sources">
<columns names="id" ref-type="src-columns"/>
</constraint>
<constraint name="poi_sources_source_key" type="uq-constr" table="public.poi_sources">
<columns names="source,remote_source_id" ref-type="src-columns"/>
</constraint>
<constraint name="poi_sources_locale_key" type="uq-constr" table="public.poi_sources">
<columns names="locale_id,source" ref-type="src-columns"/>
</constraint>
</table>
<constraint name="content_comments_author_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.users" table="public.content_comments">
<columns names="author" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="content_comments_content_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.contents" table="public.content_comments">
<columns names="content" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="content_comments_locale_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.locales" table="public.content_comments">
<columns names="locale" ref-type="src-columns"/>
<columns names="name" ref-type="dst-columns"/>
</constraint>
<constraint name="content_contributors_contributor_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.users" table="public.content_contributors">
<columns names="contributor" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="content_contributors_content_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.content_locales" table="public.content_contributors">
<columns names="content" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_comments_author_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.users" table="public.poi_comments">
<columns names="author" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_comments_locale_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.locales" table="public.poi_comments">
<columns names="locale" ref-type="src-columns"/>
<columns names="name" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_comments_poi_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.poi_sources" table="public.poi_comments">
<columns names="poi" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_contributors_contributor_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.users" table="public.poi_contributors">
<columns names="contributor" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_contributors_poi_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.poi_sources" table="public.poi_contributors">
<columns names="poi" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_localised_locale_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.locales" table="public.poi_locales">
<columns names="locale" ref-type="src-columns"/>
<columns names="name" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_locales_poi_fkey" type="fk-constr" comparison-type="MATCH FULL"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.pois" table="public.poi_locales">
<columns names="poi_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="users_locale_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.locales" table="public.users">
<columns names="locale" ref-type="src-columns"/>
<columns names="name" ref-type="dst-columns"/>
</constraint>
<constraint name="content_locales_locale" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.locales" table="public.content_locales">
<columns names="locale" ref-type="src-columns"/>
<columns names="name" ref-type="dst-columns"/>
</constraint>
<constraint name="content_locales_content" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.contents" table="public.content_locales">
<columns names="content_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="content_locales_author" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.users" table="public.content_locales">
<columns names="author" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="content_versions_locale" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.content_locales" table="public.content_versions">
<columns names="locale_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_versions_source_fkey" type="fk-constr" comparison-type="MATCH SIMPLE"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.poi_sources" table="public.poi_versions">
<columns names="source_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_sources_locale_fkey" type="fk-constr" comparison-type="MATCH FULL"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.sources" table="public.poi_sources">
<columns names="source" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="poi_sources_poi_locale_fkey" type="fk-constr" comparison-type="MATCH FULL"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.poi_locales" table="public.poi_sources">
<columns names="locale_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<relationship name="rel_content_comments_users" type="relfk" layer="0"
src-table="public.content_comments"
dst-table="public.users" reference-fk="content_comments_author_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_content_comments_contents" type="relfk" layer="0"
src-table="public.content_comments"
dst-table="public.contents" reference-fk="content_comments_content_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_content_comments_locales" type="relfk" layer="0"
src-table="public.content_comments"
dst-table="public.locales" reference-fk="content_comments_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_content_contributors_users" type="relfk" layer="0"
src-table="public.content_contributors"
dst-table="public.users" reference-fk="content_contributors_contributor_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_content_contributors_content_locales" type="relfk" layer="0"
src-table="public.content_contributors"
dst-table="public.content_locales" reference-fk="content_contributors_content_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_comments_users" type="relfk" layer="0"
src-table="public.poi_comments"
dst-table="public.users" reference-fk="poi_comments_author_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_comments_locales" type="relfk" layer="0"
src-table="public.poi_comments"
dst-table="public.locales" reference-fk="poi_comments_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_comments_poi_sources" type="relfk" layer="0"
src-table="public.poi_comments"
dst-table="public.poi_sources" reference-fk="poi_comments_poi_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_contributors_users" type="relfk" layer="0"
src-table="public.poi_contributors"
dst-table="public.users" reference-fk="poi_contributors_contributor_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_contributors_poi_sources" type="relfk" layer="0"
src-table="public.poi_contributors"
dst-table="public.poi_sources" reference-fk="poi_contributors_poi_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_locales_locales" type="relfk" layer="0"
src-table="public.poi_locales"
dst-table="public.locales" reference-fk="poi_localised_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_users_locales" type="relfk" layer="0"
src-table="public.users"
dst-table="public.locales" reference-fk="users_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_content_locales_locales" type="relfk" layer="0"
src-table="public.content_locales"
dst-table="public.locales" reference-fk="content_locales_locale"
src-required="false" dst-required="false"/>
<relationship name="rel_content_locales_contents" type="relfk" layer="0"
src-table="public.content_locales"
dst-table="public.contents" reference-fk="content_locales_content"
src-required="false" dst-required="false"/>
<relationship name="rel_content_locales_users" type="relfk" layer="0"
src-table="public.content_locales"
dst-table="public.users" reference-fk="content_locales_author"
src-required="false" dst-required="false"/>
<relationship name="rel_content_versions_content_locales" type="relfk" layer="0"
src-table="public.content_versions"
dst-table="public.content_locales" reference-fk="content_versions_locale"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_versions_poi_sources" type="relfk" layer="0"
src-table="public.poi_versions"
dst-table="public.poi_sources" reference-fk="poi_versions_source_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_sources_sources" type="relfk" layer="0"
src-table="public.poi_sources"
dst-table="public.sources" reference-fk="poi_sources_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_sources_poi_locales" type="relfk" layer="0"
src-table="public.poi_sources"
dst-table="public.poi_locales" reference-fk="poi_sources_poi_locale_fkey"
src-required="false" dst-required="false"/>
<relationship name="rel_poi_locales_pois" type="relfk" layer="0"
src-table="public.poi_locales"
dst-table="public.pois" reference-fk="poi_locales_poi_fkey"
src-required="false" dst-required="false"/>
</dbmodel>

View File

@@ -1,13 +1,98 @@
--
-- PostgreSQL database cluster dump
--
-- Started on 2026-01-18 12:08:46 CET
\restrict Vo9pvwDXJIf75fDuoiSssKAh6h5MlmsSkxna9XzLsIIrNFMYy7ouBnJFgdYDTz1
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Roles
--
CREATE ROLE kabano;
ALTER ROLE kabano WITH NOSUPERUSER INHERIT CREATEROLE CREATEDB LOGIN NOREPLICATION NOBYPASSRLS;
CREATE ROLE postgres;
ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS;
--
-- User Configurations
--
\unrestrict Vo9pvwDXJIf75fDuoiSssKAh6h5MlmsSkxna9XzLsIIrNFMYy7ouBnJFgdYDTz1
--
-- Databases
--
--
-- Database "template1" dump
--
\connect template1
-- --
-- PostgreSQL database dump -- PostgreSQL database dump
-- --
-- Dumped from database version 13.4 \restrict ummzFdMCuQi2hVOPV4ZG7xWN20nL1zOFWVZGCkEV2iYf3DgCWqzp9GP1t5yKc4x
-- Dumped by pg_dump version 13.4
-- Dumped from database version 18.1
-- Dumped by pg_dump version 18.1
-- Started on 2026-01-18 12:08:46 CET
SET statement_timeout = 0; SET statement_timeout = 0;
SET lock_timeout = 0; SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0; SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
-- Completed on 2026-01-18 12:08:46 CET
--
-- PostgreSQL database dump complete
--
\unrestrict ummzFdMCuQi2hVOPV4ZG7xWN20nL1zOFWVZGCkEV2iYf3DgCWqzp9GP1t5yKc4x
--
-- Database "kabano" dump
--
--
-- PostgreSQL database dump
--
\restrict ZbJkJonWlBZt2UiRpHhM137JrUosggX2HYJ3KfVr0ctrypNzB9xAQ8c1QWAG9ym
-- Dumped from database version 18.1
-- Dumped by pg_dump version 18.1
-- Started on 2026-01-18 12:08:46 CET
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8'; SET client_encoding = 'UTF8';
SET standard_conforming_strings = on; SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false); SELECT pg_catalog.set_config('search_path', '', false);
@@ -17,22 +102,60 @@ SET client_min_messages = warning;
SET row_security = off; SET row_security = off;
-- --
-- Name: topology; Type: SCHEMA; Schema: -; Owner: kabano -- TOC entry 4518 (class 1262 OID 16389)
-- Name: kabano; Type: DATABASE; Schema: -; Owner: postgres
-- --
CREATE SCHEMA topology; CREATE DATABASE kabano WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'fr_FR.UTF-8';
ALTER SCHEMA topology OWNER TO kabano; ALTER DATABASE kabano OWNER TO postgres;
\unrestrict ZbJkJonWlBZt2UiRpHhM137JrUosggX2HYJ3KfVr0ctrypNzB9xAQ8c1QWAG9ym
\connect kabano
\restrict ZbJkJonWlBZt2UiRpHhM137JrUosggX2HYJ3KfVr0ctrypNzB9xAQ8c1QWAG9ym
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
-- --
-- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: kabano -- TOC entry 6 (class 2615 OID 2200)
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
-- --
COMMENT ON SCHEMA topology IS 'PostGIS Topology schema'; -- *not* creating schema, since initdb creates it
ALTER SCHEMA public OWNER TO postgres;
--
-- TOC entry 2 (class 3079 OID 16816)
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
-- --
-- TOC entry 4520 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
--
-- TOC entry 1632 (class 1247 OID 16391)
-- Name: content_type_enum; Type: TYPE; Schema: public; Owner: kabano -- Name: content_type_enum; Type: TYPE; Schema: public; Owner: kabano
-- --
@@ -46,6 +169,7 @@ CREATE TYPE public.content_type_enum AS ENUM (
ALTER TYPE public.content_type_enum OWNER TO kabano; ALTER TYPE public.content_type_enum OWNER TO kabano;
-- --
-- TOC entry 1635 (class 1247 OID 16398)
-- Name: poi_type_enum; Type: TYPE; Schema: public; Owner: kabano -- Name: poi_type_enum; Type: TYPE; Schema: public; Owner: kabano
-- --
@@ -62,6 +186,7 @@ CREATE TYPE public.poi_type_enum AS ENUM (
ALTER TYPE public.poi_type_enum OWNER TO kabano; ALTER TYPE public.poi_type_enum OWNER TO kabano;
-- --
-- TOC entry 1638 (class 1247 OID 16412)
-- Name: user_rank_enum; Type: TYPE; Schema: public; Owner: kabano -- Name: user_rank_enum; Type: TYPE; Schema: public; Owner: kabano
-- --
@@ -78,6 +203,7 @@ CREATE TYPE public.user_rank_enum AS ENUM (
ALTER TYPE public.user_rank_enum OWNER TO kabano; ALTER TYPE public.user_rank_enum OWNER TO kabano;
-- --
-- TOC entry 220 (class 1259 OID 16425)
-- Name: content_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: content_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -89,13 +215,14 @@ CREATE SEQUENCE public.content_comments_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.content_comments_sequence OWNER TO kabano; ALTER SEQUENCE public.content_comments_sequence OWNER TO kabano;
SET default_tablespace = ''; SET default_tablespace = '';
SET default_table_access_method = heap; SET default_table_access_method = heap;
-- --
-- TOC entry 221 (class 1259 OID 16426)
-- Name: content_comments; Type: TABLE; Schema: public; Owner: kabano -- Name: content_comments; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -116,6 +243,7 @@ CREATE TABLE public.content_comments (
ALTER TABLE public.content_comments OWNER TO kabano; ALTER TABLE public.content_comments OWNER TO kabano;
-- --
-- TOC entry 222 (class 1259 OID 16432)
-- Name: content_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: content_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -127,9 +255,10 @@ CREATE SEQUENCE public.content_contributors_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.content_contributors_sequence OWNER TO kabano; ALTER SEQUENCE public.content_contributors_sequence OWNER TO kabano;
-- --
-- TOC entry 223 (class 1259 OID 16433)
-- Name: content_contributors; Type: TABLE; Schema: public; Owner: kabano -- Name: content_contributors; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -143,6 +272,7 @@ CREATE TABLE public.content_contributors (
ALTER TABLE public.content_contributors OWNER TO kabano; ALTER TABLE public.content_contributors OWNER TO kabano;
-- --
-- TOC entry 224 (class 1259 OID 16437)
-- Name: content_locales_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: content_locales_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -154,9 +284,10 @@ CREATE SEQUENCE public.content_locales_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.content_locales_sequence OWNER TO kabano; ALTER SEQUENCE public.content_locales_sequence OWNER TO kabano;
-- --
-- TOC entry 225 (class 1259 OID 16438)
-- Name: content_locales; Type: TABLE; Schema: public; Owner: kabano -- Name: content_locales; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -171,6 +302,20 @@ CREATE TABLE public.content_locales (
ALTER TABLE public.content_locales OWNER TO kabano; ALTER TABLE public.content_locales OWNER TO kabano;
-- --
-- TOC entry 245 (class 1259 OID 17898)
-- Name: content_version_position; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.content_version_position (
content_version_id integer NOT NULL,
geom public.geometry(PointZ,4326) NOT NULL
);
ALTER TABLE public.content_version_position OWNER TO postgres;
--
-- TOC entry 226 (class 1259 OID 16442)
-- Name: content_versions_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: content_versions_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -182,9 +327,10 @@ CREATE SEQUENCE public.content_versions_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.content_versions_sequence OWNER TO kabano; ALTER SEQUENCE public.content_versions_sequence OWNER TO kabano;
-- --
-- TOC entry 227 (class 1259 OID 16443)
-- Name: content_versions; Type: TABLE; Schema: public; Owner: kabano -- Name: content_versions; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -194,14 +340,16 @@ CREATE TABLE public.content_versions (
update_date timestamp without time zone NOT NULL, update_date timestamp without time zone NOT NULL,
is_archive boolean DEFAULT false NOT NULL, is_archive boolean DEFAULT false NOT NULL,
name character varying(255), name character varying(255),
content text, locale_id integer NOT NULL,
locale_id integer NOT NULL content jsonb,
CONSTRAINT content_json_is_object CHECK ((jsonb_typeof(content) = 'object'::text))
); );
ALTER TABLE public.content_versions OWNER TO kabano; ALTER TABLE public.content_versions OWNER TO kabano;
-- --
-- TOC entry 228 (class 1259 OID 16451)
-- Name: contents_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: contents_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -213,9 +361,10 @@ CREATE SEQUENCE public.contents_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.contents_sequence OWNER TO kabano; ALTER SEQUENCE public.contents_sequence OWNER TO kabano;
-- --
-- TOC entry 229 (class 1259 OID 16452)
-- Name: contents; Type: TABLE; Schema: public; Owner: kabano -- Name: contents; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -232,6 +381,7 @@ CREATE TABLE public.contents (
ALTER TABLE public.contents OWNER TO kabano; ALTER TABLE public.contents OWNER TO kabano;
-- --
-- TOC entry 230 (class 1259 OID 16458)
-- Name: locales; Type: TABLE; Schema: public; Owner: kabano -- Name: locales; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -245,6 +395,7 @@ CREATE TABLE public.locales (
ALTER TABLE public.locales OWNER TO kabano; ALTER TABLE public.locales OWNER TO kabano;
-- --
-- TOC entry 231 (class 1259 OID 16461)
-- Name: poi_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: poi_comments_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -256,30 +407,10 @@ CREATE SEQUENCE public.poi_comments_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.poi_comments_sequence OWNER TO kabano; ALTER SEQUENCE public.poi_comments_sequence OWNER TO kabano;
--
-- Name: poi_comments; Type: TABLE; Schema: public; Owner: kabano
--
CREATE TABLE public.poi_comments (
id integer DEFAULT nextval('public.poi_comments_sequence'::regclass) NOT NULL,
permalink character varying(255),
version integer,
creation_date timestamp without time zone,
update_date timestamp without time zone,
author integer,
is_public boolean,
is_archive boolean,
poi integer,
comment text,
locale character varying(32)
);
ALTER TABLE public.poi_comments OWNER TO kabano;
-- --
-- TOC entry 232 (class 1259 OID 16468)
-- Name: poi_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: poi_contributors_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -291,22 +422,10 @@ CREATE SEQUENCE public.poi_contributors_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.poi_contributors_sequence OWNER TO kabano; ALTER SEQUENCE public.poi_contributors_sequence OWNER TO kabano;
--
-- Name: poi_contributors; Type: TABLE; Schema: public; Owner: kabano
--
CREATE TABLE public.poi_contributors (
id integer DEFAULT nextval('public.poi_contributors_sequence'::regclass) NOT NULL,
poi integer,
contributor integer
);
ALTER TABLE public.poi_contributors OWNER TO kabano;
-- --
-- TOC entry 233 (class 1259 OID 16473)
-- Name: poi_locales_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: poi_locales_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -318,22 +437,10 @@ CREATE SEQUENCE public.poi_locales_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.poi_locales_sequence OWNER TO kabano; ALTER SEQUENCE public.poi_locales_sequence OWNER TO kabano;
--
-- Name: poi_locales; Type: TABLE; Schema: public; Owner: kabano
--
CREATE TABLE public.poi_locales (
id integer DEFAULT nextval('public.poi_locales_sequence'::regclass) NOT NULL,
locale character varying(32) NOT NULL,
poi_id integer NOT NULL
);
ALTER TABLE public.poi_locales OWNER TO kabano;
-- --
-- TOC entry 234 (class 1259 OID 16478)
-- Name: poi_sources_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: poi_sources_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -345,24 +452,10 @@ CREATE SEQUENCE public.poi_sources_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.poi_sources_sequence OWNER TO kabano; ALTER SEQUENCE public.poi_sources_sequence OWNER TO kabano;
--
-- Name: poi_sources; Type: TABLE; Schema: public; Owner: kabano
--
CREATE TABLE public.poi_sources (
id integer DEFAULT nextval('public.poi_sources_sequence'::regclass) NOT NULL,
source character varying(3),
remote_source_id character varying(255),
author integer NOT NULL,
locale_id integer NOT NULL
);
ALTER TABLE public.poi_sources OWNER TO kabano;
-- --
-- TOC entry 235 (class 1259 OID 16483)
-- Name: poi_versions_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: poi_versions_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -374,9 +467,10 @@ CREATE SEQUENCE public.poi_versions_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.poi_versions_sequence OWNER TO kabano; ALTER SEQUENCE public.poi_versions_sequence OWNER TO kabano;
-- --
-- TOC entry 236 (class 1259 OID 16484)
-- Name: pois_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: pois_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -388,9 +482,10 @@ CREATE SEQUENCE public.pois_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.pois_sequence OWNER TO kabano; ALTER SEQUENCE public.pois_sequence OWNER TO kabano;
-- --
-- TOC entry 237 (class 1259 OID 16485)
-- Name: sources; Type: TABLE; Schema: public; Owner: kabano -- Name: sources; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -407,6 +502,7 @@ CREATE TABLE public.sources (
ALTER TABLE public.sources OWNER TO kabano; ALTER TABLE public.sources OWNER TO kabano;
-- --
-- TOC entry 238 (class 1259 OID 16490)
-- Name: users_id_sequence; Type: SEQUENCE; Schema: public; Owner: kabano -- Name: users_id_sequence; Type: SEQUENCE; Schema: public; Owner: kabano
-- --
@@ -418,9 +514,10 @@ CREATE SEQUENCE public.users_id_sequence
CACHE 1; CACHE 1;
ALTER TABLE public.users_id_sequence OWNER TO kabano; ALTER SEQUENCE public.users_id_sequence OWNER TO kabano;
-- --
-- TOC entry 239 (class 1259 OID 16491)
-- Name: users; Type: TABLE; Schema: public; Owner: kabano -- Name: users; Type: TABLE; Schema: public; Owner: kabano
-- --
@@ -444,6 +541,7 @@ CREATE TABLE public.users (
ALTER TABLE public.users OWNER TO kabano; ALTER TABLE public.users OWNER TO kabano;
-- --
-- TOC entry 4307 (class 2606 OID 16457)
-- Name: content_comments content_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_comments content_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -452,6 +550,7 @@ ALTER TABLE ONLY public.content_comments
-- --
-- TOC entry 4309 (class 2606 OID 16458)
-- Name: content_contributors content_contributors_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_contributors content_contributors_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -460,6 +559,7 @@ ALTER TABLE ONLY public.content_contributors
-- --
-- TOC entry 4311 (class 2606 OID 16459)
-- Name: content_contributors content_contributors_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_contributors content_contributors_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -468,6 +568,7 @@ ALTER TABLE ONLY public.content_contributors
-- --
-- TOC entry 4315 (class 2606 OID 16460)
-- Name: content_locales content_locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_locales content_locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -476,6 +577,7 @@ ALTER TABLE ONLY public.content_locales
-- --
-- TOC entry 4317 (class 2606 OID 16461)
-- Name: content_locales content_locales_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_locales content_locales_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -484,6 +586,16 @@ ALTER TABLE ONLY public.content_locales
-- --
-- TOC entry 4349 (class 2606 OID 17906)
-- Name: content_version_position content_version_position_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.content_version_position
ADD CONSTRAINT content_version_position_pkey PRIMARY KEY (content_version_id);
--
-- TOC entry 4319 (class 2606 OID 16462)
-- Name: content_versions content_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_versions content_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -492,6 +604,7 @@ ALTER TABLE ONLY public.content_versions
-- --
-- TOC entry 4321 (class 2606 OID 16463)
-- Name: content_versions content_versions_version_locale_key; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: content_versions content_versions_version_locale_key; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -500,6 +613,7 @@ ALTER TABLE ONLY public.content_versions
-- --
-- TOC entry 4324 (class 2606 OID 16464)
-- Name: contents contents_permalink_type_key; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: contents contents_permalink_type_key; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -508,6 +622,7 @@ ALTER TABLE ONLY public.contents
-- --
-- TOC entry 4326 (class 2606 OID 16465)
-- Name: contents contents_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: contents contents_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -516,6 +631,7 @@ ALTER TABLE ONLY public.contents
-- --
-- TOC entry 4328 (class 2606 OID 16466)
-- Name: locales locales_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: locales locales_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -524,6 +640,7 @@ ALTER TABLE ONLY public.locales
-- --
-- TOC entry 4330 (class 2606 OID 16467)
-- Name: locales locales_flag_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: locales locales_flag_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -532,6 +649,7 @@ ALTER TABLE ONLY public.locales
-- --
-- TOC entry 4332 (class 2606 OID 16468)
-- Name: locales locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: locales locales_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -540,78 +658,7 @@ ALTER TABLE ONLY public.locales
-- --
-- Name: poi_comments poi_comments_permalink_version_key; Type: CONSTRAINT; Schema: public; Owner: kabano -- TOC entry 4334 (class 2606 OID 16478)
--
ALTER TABLE ONLY public.poi_comments
ADD CONSTRAINT poi_comments_permalink_version_key UNIQUE (permalink, version);
--
-- Name: poi_comments poi_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_comments
ADD CONSTRAINT poi_comments_pkey PRIMARY KEY (id);
--
-- Name: poi_contributors poi_contributors_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_contributors
ADD CONSTRAINT poi_contributors_pkey PRIMARY KEY (id);
--
-- Name: poi_contributors poi_contributors_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_contributors
ADD CONSTRAINT poi_contributors_unique UNIQUE (poi, contributor);
--
-- Name: poi_locales poi_localised_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_locales
ADD CONSTRAINT poi_localised_pkey PRIMARY KEY (id);
--
-- Name: poi_locales poi_localised_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_locales
ADD CONSTRAINT poi_localised_unique UNIQUE (locale, poi_id);
--
-- Name: poi_sources poi_sources_locale_key; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_sources
ADD CONSTRAINT poi_sources_locale_key UNIQUE (locale_id, source);
--
-- Name: poi_sources poi_sources_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_sources
ADD CONSTRAINT poi_sources_pkey PRIMARY KEY (id);
--
-- Name: poi_sources poi_sources_source_key; Type: CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_sources
ADD CONSTRAINT poi_sources_source_key UNIQUE (source, remote_source_id);
--
-- Name: sources sources_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: sources sources_display_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -620,6 +667,7 @@ ALTER TABLE ONLY public.sources
-- --
-- TOC entry 4336 (class 2606 OID 16479)
-- Name: sources sources_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: sources sources_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -628,6 +676,7 @@ ALTER TABLE ONLY public.sources
-- --
-- TOC entry 4338 (class 2606 OID 16480)
-- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -636,6 +685,7 @@ ALTER TABLE ONLY public.users
-- --
-- TOC entry 4341 (class 2606 OID 16481)
-- Name: users users_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: users users_name_unique; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -644,6 +694,7 @@ ALTER TABLE ONLY public.users
-- --
-- TOC entry 4343 (class 2606 OID 16482)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -652,6 +703,7 @@ ALTER TABLE ONLY public.users
-- --
-- TOC entry 4304 (class 1259 OID 16550)
-- Name: content_comments_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- Name: content_comments_is_archive_index; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -659,6 +711,7 @@ CREATE INDEX content_comments_is_archive_index ON public.content_comments USING
-- --
-- TOC entry 4305 (class 1259 OID 16551)
-- Name: content_comments_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- Name: content_comments_is_public_index; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -666,6 +719,15 @@ CREATE INDEX content_comments_is_public_index ON public.content_comments USING b
-- --
-- TOC entry 4347 (class 1259 OID 17918)
-- Name: content_version_position_gix; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX content_version_position_gix ON public.content_version_position USING gist (geom);
--
-- TOC entry 4322 (class 1259 OID 16552)
-- Name: contents_is_public_index; Type: INDEX; Schema: public; Owner: kabano -- Name: contents_is_public_index; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -673,6 +735,7 @@ CREATE INDEX contents_is_public_index ON public.contents USING btree (is_public)
-- --
-- TOC entry 4312 (class 1259 OID 16553)
-- Name: fki_content_contributors_content_fkey; Type: INDEX; Schema: public; Owner: kabano -- Name: fki_content_contributors_content_fkey; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -680,6 +743,7 @@ CREATE INDEX fki_content_contributors_content_fkey ON public.content_contributor
-- --
-- TOC entry 4313 (class 1259 OID 16554)
-- Name: fki_content_contributors_contributor_fkey; Type: INDEX; Schema: public; Owner: kabano -- Name: fki_content_contributors_contributor_fkey; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -687,20 +751,7 @@ CREATE INDEX fki_content_contributors_contributor_fkey ON public.content_contrib
-- --
-- Name: poi_comments_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- TOC entry 4339 (class 1259 OID 16557)
--
CREATE INDEX poi_comments_is_archive_index ON public.poi_comments USING btree (is_archive);
--
-- Name: poi_comments_is_public_index; Type: INDEX; Schema: public; Owner: kabano
--
CREATE INDEX poi_comments_is_public_index ON public.poi_comments USING btree (is_public);
--
-- Name: users_is_archive_index; Type: INDEX; Schema: public; Owner: kabano -- Name: users_is_archive_index; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -708,6 +759,7 @@ CREATE INDEX users_is_archive_index ON public.users USING btree (is_archive);
-- --
-- TOC entry 4344 (class 1259 OID 16558)
-- Name: users_register_date_index; Type: INDEX; Schema: public; Owner: kabano -- Name: users_register_date_index; Type: INDEX; Schema: public; Owner: kabano
-- --
@@ -715,6 +767,7 @@ CREATE INDEX users_register_date_index ON public.users USING btree (register_dat
-- --
-- TOC entry 4350 (class 2606 OID 16483)
-- Name: content_comments content_comments_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_comments content_comments_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -723,6 +776,7 @@ ALTER TABLE ONLY public.content_comments
-- --
-- TOC entry 4351 (class 2606 OID 16488)
-- Name: content_comments content_comments_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_comments content_comments_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -731,6 +785,7 @@ ALTER TABLE ONLY public.content_comments
-- --
-- TOC entry 4352 (class 2606 OID 16493)
-- Name: content_comments content_comments_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_comments content_comments_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -739,6 +794,7 @@ ALTER TABLE ONLY public.content_comments
-- --
-- TOC entry 4353 (class 2606 OID 16498)
-- Name: content_contributors content_contributors_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_contributors content_contributors_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -747,6 +803,7 @@ ALTER TABLE ONLY public.content_contributors
-- --
-- TOC entry 4354 (class 2606 OID 16503)
-- Name: content_contributors content_contributors_contributor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_contributors content_contributors_contributor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -755,6 +812,7 @@ ALTER TABLE ONLY public.content_contributors
-- --
-- TOC entry 4355 (class 2606 OID 16508)
-- Name: content_locales content_locales_author; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_locales content_locales_author; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -763,6 +821,7 @@ ALTER TABLE ONLY public.content_locales
-- --
-- TOC entry 4356 (class 2606 OID 16513)
-- Name: content_locales content_locales_content; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_locales content_locales_content; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -771,6 +830,7 @@ ALTER TABLE ONLY public.content_locales
-- --
-- TOC entry 4357 (class 2606 OID 16518)
-- Name: content_locales content_locales_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_locales content_locales_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -779,6 +839,16 @@ ALTER TABLE ONLY public.content_locales
-- --
-- TOC entry 4360 (class 2606 OID 17907)
-- Name: content_version_position content_version_position_content_version_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.content_version_position
ADD CONSTRAINT content_version_position_content_version_id_fkey FOREIGN KEY (content_version_id) REFERENCES public.content_versions(id) ON DELETE CASCADE;
--
-- TOC entry 4358 (class 2606 OID 16523)
-- Name: content_versions content_versions_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: content_versions content_versions_locale; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -787,70 +857,7 @@ ALTER TABLE ONLY public.content_versions
-- --
-- Name: poi_comments poi_comments_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- TOC entry 4359 (class 2606 OID 16568)
--
ALTER TABLE ONLY public.poi_comments
ADD CONSTRAINT poi_comments_author_fkey FOREIGN KEY (author) REFERENCES public.users(id);
--
-- Name: poi_comments poi_comments_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_comments
ADD CONSTRAINT poi_comments_locale_fkey FOREIGN KEY (locale) REFERENCES public.locales(name);
--
-- Name: poi_comments poi_comments_poi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_comments
ADD CONSTRAINT poi_comments_poi_fkey FOREIGN KEY (poi) REFERENCES public.poi_sources(id);
--
-- Name: poi_contributors poi_contributors_contributor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_contributors
ADD CONSTRAINT poi_contributors_contributor_fkey FOREIGN KEY (contributor) REFERENCES public.users(id);
--
-- Name: poi_contributors poi_contributors_poi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_contributors
ADD CONSTRAINT poi_contributors_poi_fkey FOREIGN KEY (poi) REFERENCES public.poi_sources(id);
--
-- Name: poi_locales poi_localised_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_locales
ADD CONSTRAINT poi_localised_locale_fkey FOREIGN KEY (locale) REFERENCES public.locales(name);
--
-- Name: poi_sources poi_sources_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_sources
ADD CONSTRAINT poi_sources_locale_fkey FOREIGN KEY (source) REFERENCES public.sources(id) MATCH FULL;
--
-- Name: poi_sources poi_sources_poi_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
--
ALTER TABLE ONLY public.poi_sources
ADD CONSTRAINT poi_sources_poi_locale_fkey FOREIGN KEY (locale_id) REFERENCES public.poi_locales(id) MATCH FULL;
--
-- Name: users users_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano -- Name: users users_locale_fkey; Type: FK CONSTRAINT; Schema: public; Owner: kabano
-- --
@@ -859,14 +866,26 @@ ALTER TABLE ONLY public.users
-- --
-- TOC entry 4519 (class 0 OID 0)
-- Dependencies: 6
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
-- --
REVOKE ALL ON SCHEMA public FROM postgres; REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO kabano; GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2026-01-18 12:08:46 CET
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --
\unrestrict ZbJkJonWlBZt2UiRpHhM137JrUosggX2HYJ3KfVr0ctrypNzB9xAQ8c1QWAG9ym
-- Completed on 2026-01-18 12:08:46 CET
--
-- PostgreSQL database cluster dump complete
--

View File

@@ -66,6 +66,8 @@ class BlogArticle
** Populate the object using its ID ** Populate the object using its ID
*****/ *****/
public function populate($row) { public function populate($row) {
$json = json_decode($row['content'], true);
$this->content_id = $row['content_id']; $this->content_id = $row['content_id'];
$this->locale_id = $row['locale_id']; $this->locale_id = $row['locale_id'];
$this->version_id = $row['version_id']; $this->version_id = $row['version_id'];
@@ -80,7 +82,7 @@ class BlogArticle
$this->is_commentable = $row['is_commentable']; $this->is_commentable = $row['is_commentable'];
$this->type = $row['type']; $this->type = $row['type'];
$this->name = $row['name']; $this->name = $row['name'];
$this->content = $row['content']; $this->content = isset($json['text']) ? $json['text'] : '';
} }
/***** /*****
@@ -110,7 +112,9 @@ class BlogArticle
pg_prepare($con, "prepare2", $query) pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n"); or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->version, date('r'), $this->name, $this->content, $this->locale_id))
$jsonContent = json_encode(['text' => $this->content]);
$result = pg_execute($con, "prepare2", array($this->version, date('r'), $this->name, $jsonContent, $this->locale_id))
or die ("Cannot execute statement\n"); or die ("Cannot execute statement\n");
$this->version_id = pg_fetch_assoc($result)['id']; $this->version_id = pg_fetch_assoc($result)['id'];
@@ -216,7 +220,9 @@ class BlogArticle
pg_prepare($con, "prepare3", $query) pg_prepare($con, "prepare3", $query)
or die ("Cannot prepare statement\n"); or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare3", array(date('r'), $this->name, $this->content, $this->locale_id))
$jsonContent = json_encode(['text' => $this->content]);
$result = pg_execute($con, "prepare3", array(date('r'), $this->name, $jsonContent, $this->locale_id))
or die ("Cannot execute statement\n"); or die ("Cannot execute statement\n");
$this->version_id = pg_fetch_assoc($result)['id']; $this->version_id = pg_fetch_assoc($result)['id'];

View File

@@ -118,7 +118,7 @@ class Poi
$this->alt_name = $this->name; $this->alt_name = $this->name;
$this->alt_position = $this->position; $this->alt_position = $this->position;
$query = "INSERT INTO pois (is_public, permalink, creation_date, name, position, type) VALUES $query = "INSERT INTO contents (is_public, permalink, creation_date, name, position, type) VALUES
(TRUE, $1, $2, $3, $4, $5) RETURNING id"; (TRUE, $1, $2, $3, $4, $5) RETURNING id";
pg_prepare($con, "prepare1", $query) pg_prepare($con, "prepare1", $query)

View File

@@ -68,6 +68,8 @@ class WikiPage
** Populate the object using raw data from SQL ** Populate the object using raw data from SQL
*****/ *****/
public function populate($row) { public function populate($row) {
$json = json_decode($row['content'], true);
$this->content_id = $row['content_id']; $this->content_id = $row['content_id'];
$this->locale_id = $row['locale_id']; $this->locale_id = $row['locale_id'];
$this->version_id = $row['version_id']; $this->version_id = $row['version_id'];
@@ -82,7 +84,7 @@ class WikiPage
$this->is_commentable = $row['is_commentable']; $this->is_commentable = $row['is_commentable'];
$this->type = $row['type']; $this->type = $row['type'];
$this->name = $row['name']; $this->name = $row['name'];
$this->content = $row['content']; $this->content = isset($json['text']) ? $json['text'] : '';
} }
/***** /*****
@@ -112,7 +114,9 @@ class WikiPage
pg_prepare($con, "prepare2", $query) pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n"); or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->version, date('r'), $this->name, $this->content, $this->locale_id))
$jsonContent = json_encode(['text' => $this->content]);
$result = pg_execute($con, "prepare2", array($this->version, date('r'), $this->name, $jsonContent, $this->locale_id))
or die ("Cannot execute statement\n"); or die ("Cannot execute statement\n");
$this->version_id = pg_fetch_assoc($result)['id']; $this->version_id = pg_fetch_assoc($result)['id'];
@@ -218,7 +222,9 @@ class WikiPage
pg_prepare($con, "prepare3", $query) pg_prepare($con, "prepare3", $query)
or die ("Cannot prepare statement\n"); or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare3", array(date('r'), $this->name, $this->content, $this->locale_id))
$jsonContent = json_encode(['text' => $this->content]);
$result = pg_execute($con, "prepare3", array(date('r'), $this->name, $jsonContent, $this->locale_id))
or die ("Cannot execute statement\n"); or die ("Cannot execute statement\n");
$this->version_id = pg_fetch_assoc($result)['id']; $this->version_id = pg_fetch_assoc($result)['id'];