Add tox job for db revision creation
Trivial-Fix Change-Id: Ie87b84ddd546149ca5d9eaf2179c514071c75695
This commit is contained in:
parent
10a73b961c
commit
829052d6dd
@ -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``.
|
||||||
|
4
tox.ini
4
tox.ini
@ -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 =
|
||||||
|
Loading…
Reference in New Issue
Block a user