Merge "Add tox job for db revision creation"
This commit is contained in:
commit
46e825a2f4
@ -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