Add tox job for db revision creation

Trivial-Fix

Change-Id: Ie87b84ddd546149ca5d9eaf2179c514071c75695
This commit is contained in:
Marc Koderer 2016-06-22 13:24:35 +02:00 committed by Goutham Pacha Ravi
parent 10a73b961c
commit 829052d6dd
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 =