Browse Source

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
Kirsten G 4 years ago
committed by Kirsten
2 changed files with 32 additions and 0 deletions
  1. +1
  2. +31

+ 1
- 0
doc/source/contributor/index.rst View File

@ -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.

+ 31
- 0
doc/source/contributor/troubleshooting.rst View File

@ -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)