Doc Fix for Alembic multiple heads error
Add documentation to fix multiple heads Alembic error. Create file contributor/troubleshooting.rst and update contributor/index.rst. Closes-Bug: 1548371 Change-Id: I957bf1c7529f9409d8026f43d5fa8e04b9278d61
This commit is contained in:
parent
2164b26df5
commit
7482e65a2d
|
@ -14,6 +14,7 @@ project.
|
|||
Developer Contribution Guide <contributing>
|
||||
Setting Up Your Development Environment <quickstart>
|
||||
Running Tempest Tests <functional-test>
|
||||
Developer Troubleshooting Guide <troubleshooting>
|
||||
|
||||
There are some other important documents also that helps new contributors to
|
||||
contribute effectively towards code standards to the project.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
Developer Troubleshooting Guide
|
||||
================================
|
||||
|
||||
This guide is intended to provide information on how to resolve common
|
||||
problems encountered when developing code for magnum.
|
||||
|
||||
Troubleshooting MySQL
|
||||
-----------------------
|
||||
|
||||
When creating alembic migrations, developers might encounter the ``Multiple
|
||||
head revisions are present for given argument 'head'`` error.
|
||||
|
||||
This can occur when two migrations revise the same head. For example, the
|
||||
developer creates a migration locally but another migration has already been
|
||||
accepted and merged into master that revises the same head::
|
||||
|
||||
$ alembic heads
|
||||
12345 (your local head)
|
||||
67890 (new master head)
|
||||
|
||||
In order to fix this, the developer should update the down_revision of their
|
||||
local migration to point to the head of the new migration in master::
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '12345'
|
||||
down_revision = '67890'
|
||||
|
||||
Now the newest local migration should be head::
|
||||
|
||||
$ alembic heads
|
||||
12345 (your local head)
|
Loading…
Reference in New Issue