Add information about contract creation exceptions in devref

Change Ia0f39697afddec7cd04f870746a4bdd8b9410a32 introduce
contract_creation_exceptions which should be implemented in
migrations that add something in contract branch. Put some
details of its usage in devref.

Change-Id: I1a0b3d384ee8a967ce7f697886630b688843cdaa
Related-bug: #1589328
This commit is contained in:
Ann Kamyshnikova 2016-07-06 14:33:12 +03:00 committed by Ann Taraday
parent 0f8e23f235
commit 860624153f
1 changed files with 21 additions and 0 deletions

View File

@ -417,6 +417,27 @@ following directive should be added in the contraction script::
depends_on = ('<expansion-revision>',)
Expand and Contract Branch Exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In some cases, we have to have "expand" operations in contract migrations. For
example, table 'networksegments' was renamed in contract migration, so all
operations with this table are required to be in contract branch as well.
For such cases, we use the ``contract_creation_exceptions`` that should be
implemented as part of such migrations. This is needed to get functional tests
pass.
Usage::
def contract_creation_exceptions():
"""Docstring should explain why we allow such exception for contract
branch.
"""
return {
sqlalchemy_obj_type: ['name']
# For example: sa.Column: ['subnets.segment_id']
}
Expand and Contract Branch Labeling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~