Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Database Structure

Matthias Mohr edited this page Jan 7, 2015 · 8 revisions

Tables / Entities

migrations

Table used by Laravels migration tools to keep the database structure up to date. Should not be changed manually. For further information please refer to the Laravel documentation.

Columns

  • migration varchar
  • batch integer

mmm_basemap

Stores the available basemaps for the maps.

Columns

  • id incrementing primary key
    Holds the numeric id. Should not be assigned manually.
  • name varchar
    Public name for the basemap that is shown in the basemap or layer chooser of the map.
  • url varchar
    Holds the unique full qualified http-URL to the basemap webservice, e.g. a WMS.
  • active boolean
    true if published, false if it should not be used currently.

mmm_comment

Stored the comments for the geo data sets and all relevant data.

Columns

  • id incrementing primary key
    Holds the numeric id. Should not be assigned manually.
  • created_at timestamp
  • updated_at timestamp
  • geodata_id integer
    Foreign key to mmm_geodata.id. Stores mandatory the geo data set which the comment refers to.
  • layer_id nullable integer
    Foreign key to mmm_layer.id. Stores optionally the layer which the comment refers to.
  • user_id nullable integer
    Foreign key to mmm_user.id. Stores optionally the user who has written this comment. Is set to NULL when the comment if written anonymously.
  • text text
    The free text comment itself.
  • rating nullable integer
    Rating from 1 to 5. NULL if no rating is set. 0 is not allowed.
  • start nullable timestamp
  • end nullable timestamp
  • geom nullable geometry:4326
  • searchtext tsvector
    Holds the information for the full text search index. This is managed by PostgreSQL automatically and shouldn't be changed manually.

Relations

  • mmm_comment belongs to mmm_geodata (stored in geodata_id)
  • mmm_comment belongs to mmm_layer (stored in layer_id)
  • mmm_comment belongs to mmm_user (stored in user_id)

mmm_geodata

Stores the geo data set, including some chosen metadata.

Columns

  • id incrementing primary key
    Holds the numeric id. Should not be assigned manually.
  • datatype varchar
  • url varchar
    Stores the unique URL to the geo data set.
  • title text
  • abstract nullable text
  • keywords nullable text
  • author nullable text
  • copyright nullable text
  • license nullable text
  • begin nullable timestamp
  • end nullable timestamp
  • language nullable varchar
    Optional two character ISO 639-1 language code.
  • bbox nullable polygon:4326
  • searchtext tsvector
    Holds the information for the full text search index. This is managed by PostgreSQL automatically and shouldn't be changed manually.

Relations

  • mmm_geodata has many mmm_comment (stored in mmm_comment.geodata_id)
  • mmm_geodata has many mmm_layer (stored in mmm_layer.geodata_id)

mmm_layer

Stores the individual layers of geo data sets that support layers, like WMS. Geo data sets without layer support don't store any data here.

Columns

  • id incrementing primary key
    Holds the numeric id. Should not be assigned manually.
  • geodata_id integer
    Foreign key to mmm_geodata.id. Stores mandatory the geo data set which the layer belongs to. Has a unique constraint together with the name column.
  • name varchar
    Stores the internal name of the layer. Has a unique constraint together with the geodata_id column. This means you can't have the two equal layer names for an individual geo data set.
  • title varchar
    Stores the public name of the layer.
  • bbox nullable polygon:4326

Relations

  • mmm_layer belongs to mmm_geodata (stored in geodata_id)
  • mmm_layer has many mmm_comment (stored in mmm_comment.layer_id)

mmm_password_reminder

Holds the tokens temporarily that were send via email to the user to retrieve a new password. There can be multiple tokens per email address. This table doesn't need to be maintained, it's managed by Laravel automatically.

Columns

  • email varchar
    Email address that requested a new password.
  • token varchar
    Token that is used to validate the request.
  • created_at timestamp
    Timestamp that allows to delete old tokens when a certain time limit is reached.

Relations

  • mmm_password_reminder belongs to mmm_user (via email, which is currently not modelled in the database due to Laravel restrictions)

mmm_saved_search

Stores the settings for the saved searches and generates a permalink which allows to redo those searches.

Columns

  • id varchar primary key
    Alphanumeric hash to identify the searches. This id is used for the permalinks.
  • keywords varchar
  • metadata boolean
    If set to false the keywords are only searched in the texts of the comments. Otherwise the metadata of the geo data sets are additionally used for searching. This field is only relevant when the keywords field is not empty.
  • rating nullable integer
    Rating from 1 to 5. NULL if no rating is set. 0 is not allowed.
  • start nullable timestamp
  • end nullable timestamp
  • location nullable point:4326
    Holds the central position for the radius based search. This can not used together with the bbox field.
  • radius nullable integer
    Holds the radius for the search in km. This field is only relevant when a location is set.
  • bbox nullable polygon:4326
    Holds the bounding box for restricting the search. This can not used together with the location field.

mmm_session

Stores the session information. This table doesn't need to be maintained, it's managed by Laravel.

Columns

  • id varchar
    Unique hash that identifies the session and is used for transmission.
  • payload text
  • last_activity integer

mmm_user

Stores the information of the registered users.

Columns

  • id incrementing primary key
    Holds the numeric id. Should not be assigned manually.
  • name varchar
    Unique public name of the registered user.
  • password nullable varchar
    Password is NULL for users registered with OAuth. The content of this field is encrypted using bcrypt.
  • email varchar
    Unique email address of the registered user.
  • language nullable varchar
    Optional two character ISO 639-1 language code. If set to NULL, default language from app config will be used.
  • remember_token nullable varchar

Relations

  • mmm_user has many mmm_password_reminder (via email, which is currently not modelled in the database due to Laravel restrictions)
  • mmm_user has many mmm_comment (stored in mmm_comment.user_id)

spatial_ref_sys

Table used by PostGIS to store information about spatial reference systems. Should not be changed. For further information please refer to the PostGIS documentation.

Clone this wiki locally