From commits-return-1234-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Mon Jul 23 18:43:16 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0A892180647 for ; Mon, 23 Jul 2018 18:43:15 +0200 (CEST) Received: (qmail 92925 invoked by uid 500); 23 Jul 2018 16:43:15 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 92916 invoked by uid 99); 23 Jul 2018 16:43:15 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2018 16:43:15 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 946FD81E15; Mon, 23 Jul 2018 16:43:14 +0000 (UTC) Date: Mon, 23 Jul 2018 16:43:14 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: Fix the build by merging both db migrations heads (#5464) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153236419438.17106.8336668203675442461@gitbox.apache.org> From: maximebeauchemin@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7fcc2af68f79a8a78e1799feb80647ae90ac9370 X-Git-Newrev: 971e9f09938464e013447a9a54397b268f6bddbf X-Git-Rev: 971e9f09938464e013447a9a54397b268f6bddbf X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 971e9f0 Fix the build by merging both db migrations heads (#5464) 971e9f0 is described below commit 971e9f09938464e013447a9a54397b268f6bddbf Author: Maxime Beauchemin AuthorDate: Mon Jul 23 09:43:09 2018 -0700 Fix the build by merging both db migrations heads (#5464) --- CONTRIBUTING.md | 18 ++++++++++++++++++ superset/migrations/versions/705732c70154_.py | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08547f0..6e20d61 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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, '@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. diff --git a/superset/migrations/versions/705732c70154_.py b/superset/migrations/versions/705732c70154_.py new file mode 100644 index 0000000..212f69a --- /dev/null +++ b/superset/migrations/versions/705732c70154_.py @@ -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