README.md 1.73 KB
Newer Older
1
# `OBM Buildings` Database Management
Felix Delattre's avatar
Felix Delattre committed
2
3
4
5
6

This repository handles the structure and migrations in the `obm_buildings` database.

The database is described through sql files in the `migrations/` directory.

7
8
9
10
11
12
13
14
15
16
## Criteria for database adjustments and build-up

This database is meant to be the core for collaboration and it is essential that it qualifies in terms of quality, functionality and fits into the whole picture.
Please add a small reasoning around the following points for each proposed merge request:

* Must be necessary and have explicit/implemented use (in one of our applications and appliances related to the Global Dynamic Exposure).
* Must be proven to work (according to requirements and direct use).
* Must be scalable to a global level.
* Must be introduced in small steps (one at a time).

17
18
19
20
## Database tables

####  `obm_buildings` - Main OBM Tiles information

Felix Delattre's avatar
Felix Delattre committed
21
22
23
| column_name | data_type                 |
|-------------|---------------------------|
| osm_id      | integer (primary key)     |
24
| geometry    | geometry (Geometry, 4326) |
Felix Delattre's avatar
Felix Delattre committed
25
| floorspace  | float                     |
Felix Delattre's avatar
Felix Delattre committed
26
| storeys     | integer                   |
Felix Delattre's avatar
Felix Delattre committed
27
| relation_id | integer                   |
Felix Delattre's avatar
Felix Delattre committed
28
| quadkey     | char(18)                  |
29
| occupancy   | text                      |
Laurens Oostwegel's avatar
Laurens Oostwegel committed
30
| last_update | timestamp                 |
31
32
33
34
35
36
37
38
39
40
41

#### `migrations` - Information about database migrations

Created and managed by [inyuu](https://git.gfz-potsdam.de/dynamicexposure/openbuildingmap/inyuu):

| column_name | data_type    |
|-------------|--------------|
| name        | varchar(100) |
| hash        | varchar(60)  |
| executed_at | timestamp    |

Felix Delattre's avatar
Felix Delattre committed
42
43
44
## More information

* [Database versioning best practices](https://enterprisecraftsmanship.com/posts/database-versioning-best-practices/)