Skip to content
Snippets Groups Projects
Commit acfc03ab authored by Florian Gransee's avatar Florian Gransee
Browse files

Add schema thing mapping table

parent 0dd80778
No related branches found
No related tags found
1 merge request!169Add schema thing mapping table
......@@ -93,6 +93,7 @@ services:
- "./data/postgres/sms_cv_db/sms_cv_foreign_tables.sql:/sql/sms_cv/sms_cv_foreign_tables.sql"
- "./data/postgres/sms_cv_db/sms_cv_init_tables.sh:/docker-entrypoint-initdb.d/02_sms_cv_init_tables.sh"
- "./data/postgres/postgis.sh:/docker-entrypoint-initdb.d/03_postgis.sh"
- "./migrations/init_schema_thing_mapping.sh:/docker-entrypoint-initdb.d/04_schema_thing_mapping.sh"
- "./mosquitto/mosquitto-go-auth.sh:/docker-entrypoint-initdb.d/mosquitto-go-auth.sh:ro"
- "./frontend/frontend-database.sh:/docker-entrypoint-initdb.d/frontend-database.sh:ro"
- "./dispatcher/s3_to_db.sh:/docker-entrypoint-initdb.d/s3_to_db.sh:ro"
......@@ -106,7 +107,7 @@ services:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
interval: "${POSTGRES_HEALTHCHECK_INTERVAL}"
timeout: 5s
retries: 5
retries: 10
# Summary
# =======
......@@ -245,7 +246,7 @@ services:
--id docker-compose-healthcheck"]
interval: "${MQTT_BROKER_HEALTHCHECK_INTERVAL}"
timeout: 10s
retries: 6
retries: 12
logging:
options:
max-size: "${MQTT_BROKER_LOG_SIZE}"
......
#!/bin/bash
set -e
echo 'Create schema-thing-mapping table if not exists'
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL
CREATE TABLE IF NOT EXISTS public."schema_thing_mapping"(
"schema" VARCHAR(100) NOT NULL,
"thing_uuid" UUID NOT NULL,
UNIQUE("schema", "thing_uuid"));
EOSQL
echo 'schema-thing-mapping table created'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment