Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the build by merging both db migrations heads #5464

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,21 @@ https://github.com/apache/incubator-superset/pull/3013
with a PGP key and providing MD5, Apache voting, as well as
publishing to Apache's SVN repository. View the ASF docs for more
information.


## Merging DB migrations

When 2 db migrations collide, you'll get an error message like this one:

```
alembic.util.exc.CommandError: Multiple head revisions are present for
given argument 'head'; please specify a specific target
revision, '<branchname>@head' to narrow to a specific head,
or 'heads' for all heads`
```

To fix it, first run `superset db heads`, this should list 2 or more
migration hashes. Then run
`superset db merge {PASTE_SHA1_HERE} {PASTE_SHA2_HERE}`. This will create
a new merge migration. You can then `superset db upgrade` to this new
checkpoint.
22 changes: 22 additions & 0 deletions superset/migrations/versions/705732c70154_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""empty message

Revision ID: 705732c70154
Revises: ('4451805bbaa1', '1d9e835a84f9')
Create Date: 2018-07-22 21:51:19.235558

"""

# revision identifiers, used by Alembic.
revision = '705732c70154'
down_revision = ('4451805bbaa1', '1d9e835a84f9')

from alembic import op
import sqlalchemy as sa


def upgrade():
pass


def downgrade():
pass