From bede0c9046466425b7aa363d967294150fcfc61c Mon Sep 17 00:00:00 2001
From: Felix Delattre <fd@gfz-potsdam.de>
Date: Wed, 17 Mar 2021 11:06:09 +0000
Subject: [PATCH] Added base table

---
 README.md                                 | 24 +++++++++++++++++++++++
 migrations/00001_create-initial-table.sql |  8 ++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 migrations/00001_create-initial-table.sql

diff --git a/README.md b/README.md
index 81997ba..cb19106 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,27 @@
 # `GDE Tiles` Database Management
 
 This repository handles the structure and migrations in the `gde_tiles` database.
+
+The database is described through SQL files in the `migrations/` directory.
+
+## Database tables
+
+####  `gde_tiles` - Main `GDE Tiles` information
+
+| column name  | data type          |
+|--------------|--------------------|
+| quadkey      | text (primary key) |
+
+#### `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/)
diff --git a/migrations/00001_create-initial-table.sql b/migrations/00001_create-initial-table.sql
new file mode 100644
index 0000000..17e1fcc
--- /dev/null
+++ b/migrations/00001_create-initial-table.sql
@@ -0,0 +1,8 @@
+CREATE TABLE public.gde_tiles
+(
+    quadkey TEXT NOT NULL,
+    CONSTRAINT quadkey PRIMARY KEY (quadkey)
+);
+
+ALTER TABLE public.gde_tiles
+    OWNER to postgres;
-- 
GitLab