Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
OpenBuildingMap
database-obmbuildings
Commits
a11f45f2
Commit
a11f45f2
authored
Mar 08, 2021
by
Felix Delattre
Browse files
Added basic database structure
parent
c9e58a5f
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a11f45f2
# OBM
-
Buildings Database Management
#
`
OBM
Buildings
`
Database Management
This repository handles the structure and migrations in the
`obm_buildings`
database.
The database is described through sql files in the
`migrations/`
directory.
## Database tables
#### `obm_buildings` - Main OBM Tiles information
| column_name | data_type |
|-------------|--------------------------|
| osm_id | integer (primary key) |
| geometry | geometry (Polygon, 4326) |
#### `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 |
## More information
*
[
Database versioning best practices
](
https://enterprisecraftsmanship.com/posts/database-versioning-best-practices/
)
migrations/00001_create-main-table.sql
0 → 100644
View file @
a11f45f2
-- Create the `obm_buildings` table
CREATE
TABLE
public
.
obm_buildings
(
osm_id
integer
PRIMARY
KEY
);
ALTER
TABLE
public
.
obm_buildings
OWNER
to
postgres
;
migrations/00002_create-postgis-extension.sql
0 → 100644
View file @
a11f45f2
-- Create PostGIS extension
CREATE
EXTENSION
IF
NOT
EXISTS
postgis
;
migrations/00003_add_column_geometry.sql
0 → 100644
View file @
a11f45f2
ALTER
TABLE
public
.
obm_buildings
ADD
COLUMN
IF
NOT
EXISTS
geometry
geometry
(
Polygon
,
4326
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment