kabano/_ressources/database_drawing

116 lines
3.3 KiB
Plaintext
Raw Normal View History

2018-03-26 20:21:41 +00:00
# Database structure for kabano.org open-source project
# This file is designed to be imported in quickdatabasediagrams.com
2018-05-08 10:58:57 +00:00
locales
2018-03-26 21:07:31 +00:00
-
2018-05-08 10:58:57 +00:00
name PK varchar(32)
display_name UNIQUE varchar(255)
2018-06-10 16:35:11 +00:00
flag_name UNIQUE NULL varchar(32)
2018-03-26 21:07:31 +00:00
2018-05-08 10:58:57 +00:00
users
2018-03-26 20:21:41 +00:00
-
2018-05-08 10:58:57 +00:00
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)
2018-03-26 20:21:41 +00:00
is_avatar_present boolean
2018-05-08 10:58:57 +00:00
is_archive INDEX boolean
2018-06-10 16:35:11 +00:00
rank user_rank_enum # blocked; registered; premium; moderator; admin
2018-05-08 10:58:57 +00:00
locale varchar(32) FK >- locales.name
timezone varchar(8)
visit_date timestamp
register_date INDEX timestamp
2018-03-26 21:07:31 +00:00
2018-05-08 10:58:57 +00:00
pois
2018-03-26 21:07:31 +00:00
-
2018-05-08 10:58:57 +00:00
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
2018-06-11 18:56:59 +00:00
type INDEX poi_type_enum # basic_hut; wilderness_hut; alpine_hut; halt; bivouac; campsite
2018-05-08 10:58:57 +00:00
is_destroyed INDEX boolean
name varchar(255)
alt_names NULL varchar(255)
source NULL varchar(3) FK >- poi_sources.id
2018-06-09 12:35:25 +00:00
source_id NULL varchar(255)
2018-05-08 10:58:57 +00:00
position geometry # Contains elevation data
2018-06-11 18:56:59 +00:00
parameters NULL jsonb
2018-03-26 21:07:31 +00:00
2018-05-08 10:58:57 +00:00
poi_localised
2018-03-26 21:07:31 +00:00
-
2018-05-08 10:58:57 +00:00
id PK int4
2018-06-11 18:56:59 +00:00
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
2018-05-08 10:58:57 +00:00
value text
2018-03-26 21:07:31 +00:00
2018-05-08 10:58:57 +00:00
poi_sources
2018-03-26 21:07:31 +00:00
-
2018-05-08 10:58:57 +00:00
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)
2018-03-26 21:07:31 +00:00
2018-05-08 10:58:57 +00:00
poi_contributors
2018-03-26 21:07:31 +00:00
-
2018-05-08 10:58:57 +00:00
id PK int4
poi UNIQUE int4 FK >- pois.id # The unique constraint is done with contributor
2018-06-09 12:35:25 +00:00
contributor UNIQUE int4 FK >- users.id # The unique constraint is done with poi
2018-06-10 15:45:45 +00:00
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
2018-06-09 12:35:25 +00:00
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