Commit a11f45f2 authored by Felix Delattre's avatar Felix Delattre
Browse files

Added basic database structure

parent c9e58a5f
# 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/)
-- Create the `obm_buildings` table
CREATE TABLE public.obm_buildings
(
osm_id integer PRIMARY KEY
);
ALTER TABLE public.obm_buildings
OWNER to postgres;
-- Create PostGIS extension
CREATE EXTENSION IF NOT EXISTS postgis;
ALTER TABLE public.obm_buildings
ADD COLUMN IF NOT EXISTS geometry geometry (Polygon, 4326);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment