From 3c75c243388df252c19e687e8b2f73ca72a5d325 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Tue, 15 Oct 2024 17:34:49 +0200 Subject: [PATCH 1/3] delete alembic script and update readme --- README.md | 19 ++++--------------- ci/win32/db_models_apply_schema.cmd | 7 ------- 2 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 ci/win32/db_models_apply_schema.cmd diff --git a/README.md b/README.md index 649c352..9c814f5 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,6 @@ extension `.sh). - `create_venv`: Creates a local virtual environment (`.venv/`) in which all dependencies may be installed. -- `db_models_apply_schema`: Will apply all available SQL db schema revisions to the local SQL - database. - `db_models_generate_new_revision`: Can be used to generate a new revision of the SQL db schema. Expects 1 argument e.g. `ci/linux/db_models_generate_new_revision.sh "this is the revision message`. @@ -103,22 +101,13 @@ This will update the reference to point to the correct submodule commit. First set up the development environment with `create_venv` and `install_dependencies`. Then you can make the necessary changes to `omotes_orchestrator/db_models/`. Finally, a new SQL schema -revision may be generated using `alembic` by running `db_models_generate_new_revision`. In order to -apply -all database revisions you can run `db_models_apply_schema`. - -Do not forget to actually start the PostgreSQL database locally! -This may be done with: - +revision may be generated using `alembic` by running: ```bash -cd computation-engine-at-orchestrator/ -cp .env-template .env -./scripts/setup.sh -./scripts/start_postgres_in_dev_mode.sh # This will start PostgreSQL with port 5432 opened on localhost -cd ../ -./ci/linux/db_models_apply_schema.sh # Setup will not apply the current schema but only create the SQL database. +./ci/linux/db_models_generate_new_revision.sh "revision message" ``` +All database revisions will be automatically applied when omotes-rest is started. + ## Direct Alembic control In case more control is necessary, you can run the necessary alembic commands directly after diff --git a/ci/win32/db_models_apply_schema.cmd b/ci/win32/db_models_apply_schema.cmd deleted file mode 100644 index b569819..0000000 --- a/ci/win32/db_models_apply_schema.cmd +++ /dev/null @@ -1,7 +0,0 @@ - -pushd . -cd /D "%~dp0" -cd ..\..\ -cd src\ -alembic upgrade head -popd From 4e6a660de596883f3d6f5b60a25f2f4439b7c919 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Tue, 15 Oct 2024 17:36:20 +0200 Subject: [PATCH 2/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c814f5..9bda6c2 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ revision may be generated using `alembic` by running: ./ci/linux/db_models_generate_new_revision.sh "revision message" ``` -All database revisions will be automatically applied when omotes-rest is started. +All database revisions will be automatically applied when the orchestrator is started. ## Direct Alembic control From e2ae34777a201a1c5aeda548ca530ad7a3c58036 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Tue, 15 Oct 2024 17:41:21 +0200 Subject: [PATCH 3/3] delete apply db models script --- ci/linux/db_models_apply_schema.sh | 9 --------- 1 file changed, 9 deletions(-) delete mode 100755 ci/linux/db_models_apply_schema.sh diff --git a/ci/linux/db_models_apply_schema.sh b/ci/linux/db_models_apply_schema.sh deleted file mode 100755 index 5d5e436..0000000 --- a/ci/linux/db_models_apply_schema.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then - echo "Activating .venv first." - . .venv/bin/activate -fi - -cd src/ -alembic upgrade head