Skip to content

Release script checks refs to versions in changelog #63

Release script checks refs to versions in changelog

Release script checks refs to versions in changelog #63

---
# yamllint disable rule:line-length
name: Database upgrade/downgrade
# yamllint disable-line rule:truthy
on:
push:
paths:
- .github/scripts/create_config_file.sh
- .github/scripts/mysql_local_setup.sh
- .github/scripts/python_setup.sh
- .github/workflows/database-upgrade-downgrade.yml
- 'server/camcops_server/**'
jobs:
database-upgrade-downgrade:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Set up MySQL
run: |
${GITHUB_WORKSPACE}/.github/scripts/mysql_local_setup.sh
- name: Database upgrade/downgrade
run: |
set -eux -o pipefail
${GITHUB_WORKSPACE}/.github/scripts/python_setup.sh
source ${HOME}/venv/bin/activate
export CAMCOPS_CONFIG_FILE="${HOME}/camcops.cfg"
${GITHUB_WORKSPACE}/.github/scripts/create_config_file.sh
python -m pip install pymysql
camcops_server upgrade_db --config ${CAMCOPS_CONFIG_FILE} --show_sql_only
camcops_server upgrade_db --config ${CAMCOPS_CONFIG_FILE}
# WARNING: Current Alembic v1.0.0 bug in downgrading with as_sql=True; may fail
# camcops_server dev_downgrade_db --config ${CAMCOPS_CONFIG_FILE} --destination_db_revision 0001 --confirm_downgrade_db --show_sql_only
camcops_server dev_downgrade_db --config ${CAMCOPS_CONFIG_FILE} --destination_db_revision 0001 --confirm_downgrade_db
camcops_server upgrade_db --config ${CAMCOPS_CONFIG_FILE} --show_sql_only
camcops_server upgrade_db --config ${CAMCOPS_CONFIG_FILE}