Remove RemovedIn20Warning #144
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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/**' | |
- 'server/setup.py' | |
jobs: | |
database-upgrade-downgrade: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- 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" | |
export SQLALCHEMY_WARN_20=1 | |
${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} |