From nobody Tue Feb 10 04:53:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187362; cv=none; d=zohomail.com; s=zohoarc; b=iE6Prj3Zj9FM9qaQqu3o5bnD+snhyK6BzmEUk1QczN3ckgKU/7ZvkbEuUNN9CGYjMGJiY1VloUblUdq+vh59Lt+On5fkPeY7EDXwev8y4je3C8X7kxy4kNjC01YUu9tshApffy7DclXS7PUpbI4ExbOno+ivVBQD2+RYEkvSiK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187362; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B0f12W5FoYjMjx1YFJYH/I/e63/domRwURFRVfO/B5c=; b=HVhb54/yawoQ7R5/ytQkcFYkoAEgZTV065UU29rJCdADOxAQGnCJTDKrhIOBcED4+AGdSoQk+ZHEI8poCrj2s5wN7vt9oONLqrrTKwSgEy2PWGVl/yRdlCtgrN/GqOxX/TTLP09kV3JHCKQZ3NeaDrQZHWJR0jCAaSEdI7d13WU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579187362809664.9480292280773; Thu, 16 Jan 2020 07:09:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-Bv1pCBydNP6iw3De_fGT5w-1; Thu, 16 Jan 2020 10:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83E71800D4E; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7719489D04; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 699B9845F7; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9I8R024610 for ; Thu, 16 Jan 2020 10:09:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0F3D480890; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F17984335 for ; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187361; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B0f12W5FoYjMjx1YFJYH/I/e63/domRwURFRVfO/B5c=; b=d3+HQsgMB6OdNx4WLplF2W6fDIyVnmc0WSWNfhEQN3d0pZ2RTrUUeooyrTEorp/P6i4Cz8 B56IOkOwvpq4cC6Yu4EgWd2lzPAl58ZrjHUMawnhE0wH1EW0E8BBWug89VYILMVhMGrVKC Wp3SRfrEmgx548+Ta2OV0qDKDdU1NjU= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:04 +0100 Message-Id: <20200116150909.21388-5-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 4/9] modify database in preparation for removing is_series_head X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: Bv1pCBydNP6iw3De_fGT5w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Otherwise, Django creates the RemoveField migration before AlterIndexTogeth= er, and the latter fails to apply. Also add a default so that reverting the removal works. Signed-off-by: Paolo Bonzini --- api/migrations/0055_auto_20200116_1034.py | 24 +++++++++++++++++++++++ api/models.py | 11 +++++------ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 api/migrations/0055_auto_20200116_1034.py diff --git a/api/migrations/0055_auto_20200116_1034.py b/api/migrations/005= 5_auto_20200116_1034.py new file mode 100644 index 0000000..12ee668 --- /dev/null +++ b/api/migrations/0055_auto_20200116_1034.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2020-01-16 10:56 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0054_populate_topic'), + ] + + operations =3D [ + migrations.AlterField( + model_name=3D'message', + name=3D'is_series_head', + field=3Dmodels.BooleanField(default=3DFalse), + ), + migrations.AlterIndexTogether( + name=3D'message', + index_together=3Dset([('topic', 'date'), ('topic', 'project', = 'last_reply_date'), ('topic', 'project', 'date'), ('topic', 'last_reply_dat= e')]), + ), + ] diff --git a/api/models.py b/api/models.py index 6f4ea4b..0435527 100644 --- a/api/models.py +++ b/api/models.py @@ -457,7 +457,6 @@ class MessageManager(models.Manager): msg.stripped_subject =3D m.get_subject(strip_tags=3DTrue) msg.version =3D m.get_version() msg.prefixes =3D m.get_prefixes() - msg.is_series_head =3D False if m.is_series_head(): msg.is_series_head =3D True msg.topic =3D Topic.objects.for_stripped_subject(msg.stripped_= subject) @@ -578,7 +577,7 @@ class Message(models.Model): recipients =3D jsonfield.JSONField() tags =3D jsonfield.JSONField(default=3D[]) prefixes =3D jsonfield.JSONField(blank=3DTrue) - is_series_head =3D models.BooleanField() + is_series_head =3D models.BooleanField(default=3DFalse) is_complete =3D models.BooleanField(default=3DFalse) is_patch =3D models.BooleanField() is_merged =3D models.BooleanField(default=3DFalse, blank=3DTrue) @@ -915,10 +914,10 @@ class Message(models.Model): class Meta: unique_together =3D ("project", "message_id") index_together =3D [ - ("is_series_head", "project", "last_reply_date"), - ("is_series_head", "project", "date"), - ("is_series_head", "last_reply_date"), - ("is_series_head", "date"), + ("topic", "project", "last_reply_date"), + ("topic", "project", "date"), + ("topic", "last_reply_date"), + ("topic", "date"), ] =20 =20 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel