Skip to content

Commit d0b9550

Browse files
MammutorSönke HoffmannSonkeHoffmannRobinGummels
authored
Database now with unique stac_id and stac_url is now in collection (#266)
* added `.env` * added environment for docker-compose.yml now every connection-details are inside an `.env`. There is an `example.env` for better understanding which need to be set as connection details * added description of how to use the `.env` and `example.env` in the `README.md` * changed a few things e.g. DB_PORT --> ${DB_PORT} * now, everthing should be done. my god, help. sorry * layout issues fixed * Fixed Typo/incomplete Sentence in README.md * added `stac_id` for collections * all IDs are now written in the newer PostgrSQL standart: ```SQL id SERIAL PRIMARY KEY, ``` changed to ```SQL id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY, ``` * changed `extend` to `extent`. * Changed language used in `./api/README.md` from german to english. I wanted to thsi anyway at some point, but this is now more like a Test-commit to see if the CI/CD Pipeline triggers... * added triggering function for an auto-update search_vector, both for collections and catalogs. The search_vector includes title, description and keywords * changed the CI-Pipeline. Now also Changes in the /db will be acceped by the Pipeline * added different users for the api and crawler groups. The api has read-only acces and the crawler user full acces to the database. The acces to the database is now possible by using the users `stac_api`or `stac_crawler`. The admin user (`postgres_user`) is still available but shouldn't be used * Refactor(database): SQL trigger definitions for catalog and collection keywords. Moved triggers to 06_triggers.sql for better organization, as they depend on the respective tables created in earlier scripts. * added source_url for collections and catalogs. Now the full_json doesn`t has to be used for getting the url * resolved a Problem I had with git by hand cause I didn't found the function * to be stac conform the stac_id is not allowed to throw an error when asking for a string. So the stac_id in the database is saved as a TEXT and no longer as a INTEGER * Database: Docker config for using the same network, STAC_ID now unique and stac_url is now in collections (#262) * Add .gitignore for environment and dependencies; update docker-compose to include network configuration * Update docker-compose.yml to rename network from 'stac_network' to 'stac-network' for consistency. * db(change) source_url is now in collection and stac_id is now unique --------- Co-authored-by: Sönke Hoffmann <shoffma5@uni.muenster.de> Co-authored-by: SonkeHoffmann <hoffmann.sonke@gmx.de> Co-authored-by: Robin Tammo Gummels <github@gummels.eu>
1 parent 8f6d1ba commit d0b9550

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

crawler/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
node_modules
3+
storage

db/docker-compose.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,13 @@ services:
2222
- stac_data:/var/lib/postgresql/data
2323
- ./init:/docker-entrypoint-initdb.d
2424

25+
networks:
26+
- stac-network
27+
2528
volumes:
26-
stac_data:
29+
stac_data:
30+
31+
networks:
32+
stac-network:
33+
name: stac-network
34+
driver: bridge

db/init/03_tables_collections.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
CREATE TABLE collection (
77
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
88
stac_version TEXT,
9-
stac_id INTEGER,
9+
stac_id TEXT UNIQUE,
1010
type TEXT,
1111
title TEXT,
1212
description TEXT,
1313
license TEXT,
14+
source_url TEXT,
1415
created_at TIMESTAMP DEFAULT now(),
1516
updated_at TIMESTAMP DEFAULT now(),
1617

0 commit comments

Comments
 (0)