From 28cc52033b9e694318536b955593f41b86f7d915 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Tue, 30 Jan 2024 11:02:47 +0100 Subject: [PATCH 1/2] rename data_model to datamodel --- .docker/docker-compose.yml | 2 +- .docker/init_db.sh | 2 +- .github/workflows/release.yml | 6 +++--- data_model/app/create_app.py | 6 +++--- doc/testing.md | 2 +- scripts/dump-demodata.sh | 2 +- test/test-changelog.sh | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index daaa62fd..45484a67 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -28,7 +28,7 @@ services: image: schemaspy/schemaspy volumes: - ../model-documentation:/output - - ${SOURCE_DIR:-..}/data_model/schemaspy.properties:/schemaspy.properties + - ${SOURCE_DIR:-..}/datamodel/schemaspy.properties:/schemaspy.properties depends_on: - signalo network_mode: "service:signalo" diff --git a/.docker/init_db.sh b/.docker/init_db.sh index f6436349..45b09beb 100755 --- a/.docker/init_db.sh +++ b/.docker/init_db.sh @@ -46,7 +46,7 @@ if [ "$#" == "0" ] || [ "$1" == "build" ]; then echo '----------------------------------------' echo "Building database normally (passing argument: ${@:2})" - ./data_model/setup.sh ${@:2} + ./datamodel/setup.sh ${@:2} echo "Done ! Database ${PGSERVICE} can now be used." echo '----------------------------------------' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aece4cec..2028a62f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,16 +52,16 @@ jobs: sed -i 's|projectname="Signalo - Demo"|projectname="Signalo - v${{ github.event.release.tag_name }}"|' project/signalo.qgs sed 's/pg_signalo/pg_signalo_dev/g' project/signalo.qgs > project/signalo_dev.qgs sed 's/pg_signalo/pg_signalo_prod/g' project/signalo.qgs > project/signalo_prod.qgs - cp data_model/demo_data/this-is-the-way.jpg project/this-is-the-way.jpg + cp datamodel/demo_data/this-is-the-way.jpg project/this-is-the-way.jpg zip -r signalo-${{ github.event.release.tag_name }}-project.zip project README.md - name: zip changelogs run: | - zip -r signalo-${{ github.event.release.tag_name }}-changelogs.zip data_model/changelogs + zip -r signalo-${{ github.event.release.tag_name }}-changelogs.zip datamodel/changelogs - name: schemaspy run: | - sed -i "s/version dev/version ${{ github.event.release.tag_name }}/" data_model/schemaspy.properties + sed -i "s/version dev/version ${{ github.event.release.tag_name }}/" datamodel/schemaspy.properties docker compose run schemaspy zip -r signalo-${{ github.event.release.tag_name }}-model-documentation.zip model-documentation/* diff --git a/data_model/app/create_app.py b/data_model/app/create_app.py index 8d15926c..34fbaffc 100755 --- a/data_model/app/create_app.py +++ b/data_model/app/create_app.py @@ -29,11 +29,11 @@ def create_views(srid: int, pg_service: str): variables = {"SRID": srid} - run_sql("data_model/app/drop_schema.sql", pg_service, variables) + run_sql("datamodel/app/drop_schema.sql", pg_service, variables) - run_sql("data_model/app/create_schema.sql", pg_service, variables) + run_sql("datamodel/app/create_schema.sql", pg_service, variables) - run_sql("data_model/app/vw_edited_support.sql", pg_service, variables) + run_sql("datamodel/app/vw_edited_support.sql", pg_service, variables) vw_sign_symbol(pg_service=pg_service, srid=srid) diff --git a/doc/testing.md b/doc/testing.md index f904bb74..e2de837e 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -47,4 +47,4 @@ To start SIGNALO virtual environement automatically with Docker, use: `docker up ## Setup on an existing DB server -Run bash script to init the data model: `data_model/setup.sh -p _PG_SERVICE_` +Run bash script to init the data model: `datamodel/setup.sh -p _PG_SERVICE_` diff --git a/scripts/dump-demodata.sh b/scripts/dump-demodata.sh index e76ee82d..5dccc33f 100755 --- a/scripts/dump-demodata.sh +++ b/scripts/dump-demodata.sh @@ -5,5 +5,5 @@ TABLES=( sign azimut frame support vl_user_sign) export PGSERVICE=pg_signalo for TABLE in "${TABLES[@]}"; do - pg_dump --data-only -t signalo_db.${TABLE} --column-inserts | gsort | gsed '/^INSERT/!d' > data_model/demo_data/${TABLE}_content.sql + pg_dump --data-only -t signalo_db.${TABLE} --column-inserts | gsort | gsed '/^INSERT/!d' > datamodel/demo_data/${TABLE}_content.sql done diff --git a/test/test-changelog.sh b/test/test-changelog.sh index f34e46cc..5a39e1d3 100755 --- a/test/test-changelog.sh +++ b/test/test-changelog.sh @@ -5,9 +5,9 @@ set -e return_code=0 -for file in $(find data_model/changelogs -type f); do - if ! grep -q $(basename ${file}) data_model/setup.sh; then - echo "changelog file ${file} not found in data_model/setup.sh" +for file in $(find datamodel/changelogs -type f); do + if ! grep -q $(basename ${file}) datamodel/setup.sh; then + echo "changelog file ${file} not found in datamodel/setup.sh" return_code=1 fi done From 29524760d26bd1293313811ddad309a94543e37b Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Tue, 30 Jan 2024 11:05:40 +0100 Subject: [PATCH 2/2] rename data_model to datamodel --- {data_model => datamodel}/app/__init__.py | 0 {data_model => datamodel}/app/create_app.py | 0 {data_model => datamodel}/app/create_schema.sql | 0 {data_model => datamodel}/app/drop_schema.sql | 0 {data_model => datamodel}/app/vw_edited_support.sql | 0 {data_model => datamodel}/app/vw_sign_symbol.py | 0 .../changelogs/0001/0001_1.sql | 0 .../changelogs/0002/0002_1_sign-5.00.sql | 0 .../changelogs/0003/0003_fix_img_size.sql | 0 .../changelogs/0004/0004_fix_img_size_followup.sql | 0 .../changelogs/0005/0005_fix_vls.sql | 0 .../changelogs/0006/0006_delete_en.sql | 0 .../changelogs/0006/0006_new_signs.sql | 0 .../changelogs/0006/0006_translate_de.sql | 0 .../changelogs/0006/0006_user_signs.sql | 0 .../changelogs/0100/0100_anchor-point.sql | 0 .../changelogs/0100/0100_indexes.sql | 0 .../changelogs/0100/0100_support_photo2.sql | 0 .../changelogs/0100/0100_user_signs_img.sql | 0 .../demo_data/azimut_content.sql | 0 .../demo_data/frame_content.sql | 0 .../demo_data/owner_content.sql | 0 .../demo_data/sign_content.sql | 0 .../demo_data/support_content.sql | 0 .../demo_data/this-is-the-way.jpg | Bin .../demo_data/vl_user_sign_content.sql | 0 {data_model => datamodel}/schemaspy.properties | 0 {data_model => datamodel}/setup.sh | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename {data_model => datamodel}/app/__init__.py (100%) rename {data_model => datamodel}/app/create_app.py (100%) rename {data_model => datamodel}/app/create_schema.sql (100%) rename {data_model => datamodel}/app/drop_schema.sql (100%) rename {data_model => datamodel}/app/vw_edited_support.sql (100%) rename {data_model => datamodel}/app/vw_sign_symbol.py (100%) rename {data_model => datamodel}/changelogs/0001/0001_1.sql (100%) rename {data_model => datamodel}/changelogs/0002/0002_1_sign-5.00.sql (100%) rename {data_model => datamodel}/changelogs/0003/0003_fix_img_size.sql (100%) rename {data_model => datamodel}/changelogs/0004/0004_fix_img_size_followup.sql (100%) rename {data_model => datamodel}/changelogs/0005/0005_fix_vls.sql (100%) rename {data_model => datamodel}/changelogs/0006/0006_delete_en.sql (100%) rename {data_model => datamodel}/changelogs/0006/0006_new_signs.sql (100%) rename {data_model => datamodel}/changelogs/0006/0006_translate_de.sql (100%) rename {data_model => datamodel}/changelogs/0006/0006_user_signs.sql (100%) rename {data_model => datamodel}/changelogs/0100/0100_anchor-point.sql (100%) rename {data_model => datamodel}/changelogs/0100/0100_indexes.sql (100%) rename {data_model => datamodel}/changelogs/0100/0100_support_photo2.sql (100%) rename {data_model => datamodel}/changelogs/0100/0100_user_signs_img.sql (100%) rename {data_model => datamodel}/demo_data/azimut_content.sql (100%) rename {data_model => datamodel}/demo_data/frame_content.sql (100%) rename {data_model => datamodel}/demo_data/owner_content.sql (100%) rename {data_model => datamodel}/demo_data/sign_content.sql (100%) rename {data_model => datamodel}/demo_data/support_content.sql (100%) rename {data_model => datamodel}/demo_data/this-is-the-way.jpg (100%) rename {data_model => datamodel}/demo_data/vl_user_sign_content.sql (100%) rename {data_model => datamodel}/schemaspy.properties (100%) rename {data_model => datamodel}/setup.sh (100%) diff --git a/data_model/app/__init__.py b/datamodel/app/__init__.py similarity index 100% rename from data_model/app/__init__.py rename to datamodel/app/__init__.py diff --git a/data_model/app/create_app.py b/datamodel/app/create_app.py similarity index 100% rename from data_model/app/create_app.py rename to datamodel/app/create_app.py diff --git a/data_model/app/create_schema.sql b/datamodel/app/create_schema.sql similarity index 100% rename from data_model/app/create_schema.sql rename to datamodel/app/create_schema.sql diff --git a/data_model/app/drop_schema.sql b/datamodel/app/drop_schema.sql similarity index 100% rename from data_model/app/drop_schema.sql rename to datamodel/app/drop_schema.sql diff --git a/data_model/app/vw_edited_support.sql b/datamodel/app/vw_edited_support.sql similarity index 100% rename from data_model/app/vw_edited_support.sql rename to datamodel/app/vw_edited_support.sql diff --git a/data_model/app/vw_sign_symbol.py b/datamodel/app/vw_sign_symbol.py similarity index 100% rename from data_model/app/vw_sign_symbol.py rename to datamodel/app/vw_sign_symbol.py diff --git a/data_model/changelogs/0001/0001_1.sql b/datamodel/changelogs/0001/0001_1.sql similarity index 100% rename from data_model/changelogs/0001/0001_1.sql rename to datamodel/changelogs/0001/0001_1.sql diff --git a/data_model/changelogs/0002/0002_1_sign-5.00.sql b/datamodel/changelogs/0002/0002_1_sign-5.00.sql similarity index 100% rename from data_model/changelogs/0002/0002_1_sign-5.00.sql rename to datamodel/changelogs/0002/0002_1_sign-5.00.sql diff --git a/data_model/changelogs/0003/0003_fix_img_size.sql b/datamodel/changelogs/0003/0003_fix_img_size.sql similarity index 100% rename from data_model/changelogs/0003/0003_fix_img_size.sql rename to datamodel/changelogs/0003/0003_fix_img_size.sql diff --git a/data_model/changelogs/0004/0004_fix_img_size_followup.sql b/datamodel/changelogs/0004/0004_fix_img_size_followup.sql similarity index 100% rename from data_model/changelogs/0004/0004_fix_img_size_followup.sql rename to datamodel/changelogs/0004/0004_fix_img_size_followup.sql diff --git a/data_model/changelogs/0005/0005_fix_vls.sql b/datamodel/changelogs/0005/0005_fix_vls.sql similarity index 100% rename from data_model/changelogs/0005/0005_fix_vls.sql rename to datamodel/changelogs/0005/0005_fix_vls.sql diff --git a/data_model/changelogs/0006/0006_delete_en.sql b/datamodel/changelogs/0006/0006_delete_en.sql similarity index 100% rename from data_model/changelogs/0006/0006_delete_en.sql rename to datamodel/changelogs/0006/0006_delete_en.sql diff --git a/data_model/changelogs/0006/0006_new_signs.sql b/datamodel/changelogs/0006/0006_new_signs.sql similarity index 100% rename from data_model/changelogs/0006/0006_new_signs.sql rename to datamodel/changelogs/0006/0006_new_signs.sql diff --git a/data_model/changelogs/0006/0006_translate_de.sql b/datamodel/changelogs/0006/0006_translate_de.sql similarity index 100% rename from data_model/changelogs/0006/0006_translate_de.sql rename to datamodel/changelogs/0006/0006_translate_de.sql diff --git a/data_model/changelogs/0006/0006_user_signs.sql b/datamodel/changelogs/0006/0006_user_signs.sql similarity index 100% rename from data_model/changelogs/0006/0006_user_signs.sql rename to datamodel/changelogs/0006/0006_user_signs.sql diff --git a/data_model/changelogs/0100/0100_anchor-point.sql b/datamodel/changelogs/0100/0100_anchor-point.sql similarity index 100% rename from data_model/changelogs/0100/0100_anchor-point.sql rename to datamodel/changelogs/0100/0100_anchor-point.sql diff --git a/data_model/changelogs/0100/0100_indexes.sql b/datamodel/changelogs/0100/0100_indexes.sql similarity index 100% rename from data_model/changelogs/0100/0100_indexes.sql rename to datamodel/changelogs/0100/0100_indexes.sql diff --git a/data_model/changelogs/0100/0100_support_photo2.sql b/datamodel/changelogs/0100/0100_support_photo2.sql similarity index 100% rename from data_model/changelogs/0100/0100_support_photo2.sql rename to datamodel/changelogs/0100/0100_support_photo2.sql diff --git a/data_model/changelogs/0100/0100_user_signs_img.sql b/datamodel/changelogs/0100/0100_user_signs_img.sql similarity index 100% rename from data_model/changelogs/0100/0100_user_signs_img.sql rename to datamodel/changelogs/0100/0100_user_signs_img.sql diff --git a/data_model/demo_data/azimut_content.sql b/datamodel/demo_data/azimut_content.sql similarity index 100% rename from data_model/demo_data/azimut_content.sql rename to datamodel/demo_data/azimut_content.sql diff --git a/data_model/demo_data/frame_content.sql b/datamodel/demo_data/frame_content.sql similarity index 100% rename from data_model/demo_data/frame_content.sql rename to datamodel/demo_data/frame_content.sql diff --git a/data_model/demo_data/owner_content.sql b/datamodel/demo_data/owner_content.sql similarity index 100% rename from data_model/demo_data/owner_content.sql rename to datamodel/demo_data/owner_content.sql diff --git a/data_model/demo_data/sign_content.sql b/datamodel/demo_data/sign_content.sql similarity index 100% rename from data_model/demo_data/sign_content.sql rename to datamodel/demo_data/sign_content.sql diff --git a/data_model/demo_data/support_content.sql b/datamodel/demo_data/support_content.sql similarity index 100% rename from data_model/demo_data/support_content.sql rename to datamodel/demo_data/support_content.sql diff --git a/data_model/demo_data/this-is-the-way.jpg b/datamodel/demo_data/this-is-the-way.jpg similarity index 100% rename from data_model/demo_data/this-is-the-way.jpg rename to datamodel/demo_data/this-is-the-way.jpg diff --git a/data_model/demo_data/vl_user_sign_content.sql b/datamodel/demo_data/vl_user_sign_content.sql similarity index 100% rename from data_model/demo_data/vl_user_sign_content.sql rename to datamodel/demo_data/vl_user_sign_content.sql diff --git a/data_model/schemaspy.properties b/datamodel/schemaspy.properties similarity index 100% rename from data_model/schemaspy.properties rename to datamodel/schemaspy.properties diff --git a/data_model/setup.sh b/datamodel/setup.sh similarity index 100% rename from data_model/setup.sh rename to datamodel/setup.sh