Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8C39FE00BFF; Tue, 16 Feb 2016 11:20:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.48 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 1C538E00A7D for ; Tue, 16 Feb 2016 11:20:13 -0800 (PST) Received: by mail-pa0-f48.google.com with SMTP id yy13so108020924pab.3 for ; Tue, 16 Feb 2016 11:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qtyyoEvwrkxeipJW9ZA8WuGOmJDz5tQaeCHmckPx6hk=; b=TUOpf08fNnMDQd2URzxSXyh7KIKV07RXzxc1HbiguOBaqhR+e+vkxyiz6G5oMKL0pi tJJMmI6hxEFRtvNixnvX6h8XL3nGeBr9NEj+3GTqA+wvGlhn/yQ5bSxpa1sCUVyoibW0 5UZa7ABl/bsGqlzLexOCCI2Oxi9dPlyCR+7RS6rpRyrbc+F43qUfg9zZyf3d2bweclmF gVeL0nuIQyTAGkY7P4/tPp2OsMo0MSbJQ/M6/a8Jx6wRb3kHP13oNtLB6pm0lKtZZ/0N QMtCWRv/QdjXNw0Zz/OXM8VD7veE2tnWtfoRXeosNzkIuixSC4AZ4S2TzI8nexNBqx4b Uh2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qtyyoEvwrkxeipJW9ZA8WuGOmJDz5tQaeCHmckPx6hk=; b=nLc2YikcwGvZ1EocZwYlOOrZAb8PE74THGkz0Ubw9mExxZTEmmR04w3HQihfjBIGlw m/8l/prQ/kHCW5wWebtxHED2bo1tfvNOovlifXPrEBeq4QnGCRwjObeTV/9ZERK/x0NX PjJKoa7JlHsk80Lmah/FVtEtNQZSSsM8gr/iiH5yC1RR/NJDzfU/Pm1T2XXxeAyIrIBC GCbNoUKEKOnf1SWgmddl7fbaIHL6HeArjoxbVF5ktw+j/NEU4zFwwWEJUP3OgVlZ3Z8B B5jhxlRYMUmzoDZOS3+xhGU0LWEsjles0rfhqdp0Le0YiIduF/5pmJkCMlmtGA8ZWse3 ktTg== X-Gm-Message-State: AG10YOTR/fIcbFFWXDIX9vKdCNMBrx07lTjZ21jsfMKN82py1GoEaBVHzHf7B1RNm5ZdtIan X-Received: by 10.66.62.195 with SMTP id a3mr33515008pas.28.1455650413138; Tue, 16 Feb 2016 11:20:13 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by smtp.gmail.com with ESMTPSA id 85sm47551442pfl.18.2016.02.16.11.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Feb 2016 11:20:12 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 16 Feb 2016 19:19:53 +0000 Message-Id: <1455650397-14195-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455650397-14195-1-git-send-email-michael.g.wood@intel.com> References: <1455650397-14195-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 1/5] toaster: orm migrations Sort out migrations mess X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2016 19:20:15 -0000 We messed up the migrations by squashing some of the image customisation model definitions into the initial migration which has meant some irreversible operations on mysql took place. This deletes, re-orders and fixes the migrations. If your schema is up to date you may want to use ./manage migrate with --fake or --fake-initial to avoid re-applying migrations. [YOCTO #9116] --- bitbake/lib/toaster/orm/migrations/0001_initial.py | 26 -------------- .../orm/migrations/0002_auto_20151210_1209.py | 41 ---------------------- .../orm/migrations/0002_auto_20151223_1528.py | 27 -------------- .../orm/migrations/0002_customimagerecipe.py | 24 +++++++++++++ .../orm/migrations/0003_customimagepackage.py | 2 +- bitbake/lib/toaster/orm/migrations/0004_merge.py | 15 -------- .../lib/toaster/orm/migrations/0004_provides.py | 27 ++++++++++++++ .../orm/migrations/0005_auto_20160118_1055.py | 19 ---------- .../0006_customimagerecipe_last_updated.py | 19 ---------- 9 files changed, 52 insertions(+), 148 deletions(-) delete mode 100644 bitbake/lib/toaster/orm/migrations/0002_auto_20151210_1209.py delete mode 100644 bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py create mode 100644 bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py delete mode 100644 bitbake/lib/toaster/orm/migrations/0004_merge.py create mode 100644 bitbake/lib/toaster/orm/migrations/0004_provides.py delete mode 100644 bitbake/lib/toaster/orm/migrations/0005_auto_20160118_1055.py delete mode 100644 bitbake/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py diff --git a/bitbake/lib/toaster/orm/migrations/0001_initial.py b/bitbake/lib/toaster/orm/migrations/0001_initial.py index 27fd057..760462f 100644 --- a/bitbake/lib/toaster/orm/migrations/0001_initial.py +++ b/bitbake/lib/toaster/orm/migrations/0001_initial.py @@ -58,13 +58,6 @@ class Migration(migrations.Migration): ], ), migrations.CreateModel( - name='CustomImageRecipe', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=100)), - ], - ), - migrations.CreateModel( name='HelpText', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), @@ -436,21 +429,6 @@ class Migration(migrations.Migration): field=models.ForeignKey(default=None, to='orm.LayerSource', null=True), ), migrations.AddField( - model_name='customimagerecipe', - name='base_recipe', - field=models.ForeignKey(to='orm.Recipe'), - ), - migrations.AddField( - model_name='customimagerecipe', - name='packages', - field=models.ManyToManyField(to='orm.Package'), - ), - migrations.AddField( - model_name='customimagerecipe', - name='project', - field=models.ForeignKey(to='orm.Project'), - ), - migrations.AddField( model_name='build', name='project', field=models.ForeignKey(to='orm.Project'), @@ -520,10 +498,6 @@ class Migration(migrations.Migration): unique_together=set([('layer_source', 'up_id'), ('layer_source', 'name')]), ), migrations.AlterUniqueTogether( - name='customimagerecipe', - unique_together=set([('name', 'project')]), - ), - migrations.AlterUniqueTogether( name='branch', unique_together=set([('layer_source', 'up_id'), ('layer_source', 'name')]), ), diff --git a/bitbake/lib/toaster/orm/migrations/0002_auto_20151210_1209.py b/bitbake/lib/toaster/orm/migrations/0002_auto_20151210_1209.py deleted file mode 100644 index d15ceaa..0000000 --- a/bitbake/lib/toaster/orm/migrations/0002_auto_20151210_1209.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('orm', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='customimagerecipe', - name='recipe_ptr', - field=models.OneToOneField(parent_link=True, auto_created=True, default=None, serialize=False, to='orm.Recipe'), - preserve_default=False, - ), - migrations.AlterField( - model_name='customimagerecipe', - name='base_recipe', - field=models.ForeignKey(related_name='based_on_recipe', to='orm.Recipe'), - ), - migrations.AlterUniqueTogether( - name='customimagerecipe', - unique_together=set([]), - ), - migrations.RemoveField( - model_name='customimagerecipe', - name='id', - ), - migrations.RemoveField( - model_name='customimagerecipe', - name='name', - ), - migrations.RemoveField( - model_name='customimagerecipe', - name='packages', - ), - ] diff --git a/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py b/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py deleted file mode 100644 index 194c897..0000000 --- a/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('orm', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Provides', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=100)), - ('recipe', models.ForeignKey(to='orm.Recipe')), - ], - ), - migrations.AddField( - model_name='recipe_dependency', - name='via', - field=models.ForeignKey(null=True, default=None, to='orm.Provides'), - ), - ] diff --git a/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py b/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py new file mode 100644 index 0000000..9cec82e --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('orm', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='CustomImageRecipe', + fields=[ + ('recipe_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Recipe')), + ('last_updated', models.DateTimeField(default=None, null=True)), + ('base_recipe', models.ForeignKey(related_name='based_on_recipe', to='orm.Recipe')), + ('project', models.ForeignKey(to='orm.Project')), + ], + bases=('orm.recipe',), + ), + ] diff --git a/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py b/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py index d2ea820..b027f66 100644 --- a/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py +++ b/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('orm', '0002_auto_20151210_1209'), + ('orm', '0002_customimagerecipe'), ] operations = [ diff --git a/bitbake/lib/toaster/orm/migrations/0004_merge.py b/bitbake/lib/toaster/orm/migrations/0004_merge.py deleted file mode 100644 index 5b9d122..0000000 --- a/bitbake/lib/toaster/orm/migrations/0004_merge.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('orm', '0002_auto_20151223_1528'), - ('orm', '0003_customimagepackage'), - ] - - operations = [ - ] diff --git a/bitbake/lib/toaster/orm/migrations/0004_provides.py b/bitbake/lib/toaster/orm/migrations/0004_provides.py new file mode 100644 index 0000000..dfde2d1 --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0004_provides.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('orm', '0003_customimagepackage'), + ] + + operations = [ + migrations.CreateModel( + name='Provides', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=100)), + ('recipe', models.ForeignKey(to='orm.Recipe')), + ], + ), + migrations.AddField( + model_name='recipe_dependency', + name='via', + field=models.ForeignKey(null=True, default=None, to='orm.Provides'), + ), + ] diff --git a/bitbake/lib/toaster/orm/migrations/0005_auto_20160118_1055.py b/bitbake/lib/toaster/orm/migrations/0005_auto_20160118_1055.py deleted file mode 100644 index 1120596..0000000 --- a/bitbake/lib/toaster/orm/migrations/0005_auto_20160118_1055.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('orm', '0004_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='customimagerecipe', - name='recipe_ptr', - field=models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Recipe'), - ), - ] diff --git a/bitbake/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py b/bitbake/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py deleted file mode 100644 index b7a301b..0000000 --- a/bitbake/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('orm', '0005_auto_20160118_1055'), - ] - - operations = [ - migrations.AddField( - model_name='customimagerecipe', - name='last_updated', - field=models.DateTimeField(default=None, null=True), - ), - ] -- 2.5.0