From patchwork Sat Jun 8 17:36:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1112507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Lmn51Dj4z9sBb for ; Sun, 9 Jun 2019 03:37:29 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="RmrNQaWp"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45Lmn46f0rzDqwl for ; Sun, 9 Jun 2019 03:37:28 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=172.82.139.96; helo=qrelay96.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="RmrNQaWp"; dkim-atps=neutral Received: from qrelay96.mxroute.com (qrelay96.mxroute.com [172.82.139.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45Lmm34jknzDqf1 for ; Sun, 9 Jun 2019 03:36:35 +1000 (AEST) Received: from filter001.mxrelay.co (unknown [116.203.155.46]) by qrelay96.mxroute.com (Postfix) with ESMTP id 7AC6E10086D for ; Sat, 8 Jun 2019 13:36:31 -0400 (EDT) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter001.mxrelay.co (Postfix) with ESMTPS id C809010016E for ; Sat, 8 Jun 2019 17:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8UMUWSAV7BMum6Jdb83fU/r6vGQC9faYz8ZonKZuLHE=; b=RmrNQaWpzrOj21/x3IkToi1gp6 +zWTBK7J6NEXyLH39I3ZS9D0I55t/M4tac93qiDkwIENZlbihY1OJMP+kqS86sY8Eg7SA/ZiFsZeR 2dngw6YeO+H3NSMrMrlX+5Uk6tNJ8GA87rPCpXgAxl5laeAQFY+hhmBC2hlOJdfCvJrqUHJIq2ekU 1ELUwMO6hySyeI3eONebcKEujKS47EaGV4bh98qV3XAL5nBwxMNaUGEPXMKk1+4XWkalPqxxQWat8 wVI1X7mC1PG8RpK7qlaS18iME4C/1mmjx6/362UnXFiVO7EwRt5ziPLIH/6j+gAkXHZ2jxLZEk38i f474kj0w==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v3 2/5] migrations: Correct 'unique_together' order in '0015' Date: Sat, 8 Jun 2019 18:36:19 +0100 Message-Id: <20190608173622.6711-3-stephen@that.guru> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190608173622.6711-1-stephen@that.guru> References: <20190608173622.6711-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This was resulting in exceptions like the following when used with MySQL 8.0: Traceback (most recent call last): File "../patchwork/manage.py", line 11, in execute_from_command_line(sys.argv) ... File "../.tox/py27-django111/lib/python2.7/site-packages/django/db/backends/mysql/schema.py", line 88, in _delete_composed_index return super(DatabaseSchemaEditor, self)._delete_composed_index(model, fields, *args) File "../.tox/py27-django111/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 394, in _delete_composed_index ", ".join(columns), ValueError: Found wrong number (0) of constraints for patchwork_seriespatch(series_id, number) This error was being raised by the following lines in the 0033 migration: migrations.AlterUniqueTogether( name='seriespatch', unique_together=set([]), ) It appears that this is because of a mismatch between the order of fields in a 'unique_together' constraint [1]. Correct the order in the original migration and see the issue disappear. Signed-off-by: Stephen Finucane Fixes: d67d859f40f ("models: Add 'Series' model") --- patchwork/migrations/0015_add_series_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/migrations/0015_add_series_models.py b/patchwork/migrations/0015_add_series_models.py index b7c3dc76..72223906 100644 --- a/patchwork/migrations/0015_add_series_models.py +++ b/patchwork/migrations/0015_add_series_models.py @@ -62,6 +62,6 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name='seriespatch', - unique_together=set([('series', 'number'), ('series', 'patch')]), + unique_together=set([('series', 'patch'), ('series', 'number')]), ), ]