From 3c75c243388df252c19e687e8b2f73ca72a5d325 Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Tue, 15 Oct 2024 17:34:49 +0200 Subject: [PATCH] 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