Merge "Add tox job for db revision creation"

This commit is contained in:
Jenkins 2016-07-15 18:41:29 +00:00 committed by Gerrit Code Review
commit 46e825a2f4
2 changed files with 16 additions and 0 deletions

View File

@ -52,3 +52,15 @@ Tests
Tests are lacking for the db api layer and for the sqlalchemy driver. Tests are lacking for the db api layer and for the sqlalchemy driver.
Failures in the drivers would be detected in other test cases, though. Failures in the drivers would be detected in other test cases, though.
DB migration revisions
----------------------
If a DB schema needs to be updated, a new DB migration file needs to be added
in ``manila/db/migrations/alembic/versions``. To create such a file it's
possible to use ``manila-manage db revision`` or the corresponding tox command::
tox -e dbrevision "change_foo_table"
In addition every migration script must be tested. See examples in
``manila/tests/db/migrations/alembic/migrations_data_checks.py``.

View File

@ -90,6 +90,10 @@ deps = -r{toxinidir}/requirements.txt
pylint==0.26.0 pylint==0.26.0
commands = python tools/lintstack.py check commands = python tools/lintstack.py check
[testenv:dbrevision]
deps = -r{toxinidir}/requirements.txt
commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
[flake8] [flake8]
# Following checks are ignored on purpose: # Following checks are ignored on purpose:
ignore = ignore =