]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: orm migrations Sort out migrations mess
authorMichael Wood <michael.g.wood@intel.com>
Fri, 19 Feb 2016 05:21:48 +0000 (21:21 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Feb 2016 15:38:20 +0000 (15:38 +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]

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/orm/migrations/0001_initial.py
lib/toaster/orm/migrations/0002_auto_20151210_1209.py [deleted file]
lib/toaster/orm/migrations/0002_customimagerecipe.py [new file with mode: 0644]
lib/toaster/orm/migrations/0003_customimagepackage.py
lib/toaster/orm/migrations/0004_merge.py [deleted file]
lib/toaster/orm/migrations/0004_provides.py [moved from lib/toaster/orm/migrations/0002_auto_20151223_1528.py with 94% similarity]
lib/toaster/orm/migrations/0005_auto_20160118_1055.py [deleted file]
lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py [deleted file]

index 27fd05716fae3212854640c92d827e784a2edef2..760462f6b4c83071f64c51daa6f57c8b0d1de131 100644 (file)
@@ -57,13 +57,6 @@ class Migration(migrations.Migration):
                 ('build', models.ForeignKey(to='orm.Build')),
             ],
         ),
-        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=[
@@ -435,21 +428,6 @@ class Migration(migrations.Migration):
             name='layer_source',
             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',
@@ -519,10 +497,6 @@ class Migration(migrations.Migration):
             name='layer',
             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/lib/toaster/orm/migrations/0002_auto_20151210_1209.py b/lib/toaster/orm/migrations/0002_auto_20151210_1209.py
deleted file mode 100644 (file)
index d15ceaa..0000000
+++ /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/lib/toaster/orm/migrations/0002_customimagerecipe.py b/lib/toaster/orm/migrations/0002_customimagerecipe.py
new file mode 100644 (file)
index 0000000..9cec82e
--- /dev/null
@@ -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',),
+        ),
+    ]
index d2ea8205b3aace53abdcbf4371360b08d71e9356..b027f661375dfa9a08c7eafb1fafff8d78439d1f 100644 (file)
@@ -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/lib/toaster/orm/migrations/0004_merge.py b/lib/toaster/orm/migrations/0004_merge.py
deleted file mode 100644 (file)
index 5b9d122..0000000
+++ /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 = [
-    ]
similarity index 94%
rename from lib/toaster/orm/migrations/0002_auto_20151223_1528.py
rename to lib/toaster/orm/migrations/0004_provides.py
index 194c897bdfd02f1ba8902fbea17fe1ddb7fe170f..dfde2d13615e76374ecdf876f3745fcf7d67f296 100644 (file)
@@ -7,7 +7,7 @@ from django.db import migrations, models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('orm', '0001_initial'),
+        ('orm', '0003_customimagepackage'),
     ]
 
     operations = [
diff --git a/lib/toaster/orm/migrations/0005_auto_20160118_1055.py b/lib/toaster/orm/migrations/0005_auto_20160118_1055.py
deleted file mode 100644 (file)
index 1120596..0000000
+++ /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/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py b/lib/toaster/orm/migrations/0006_customimagerecipe_last_updated.py
deleted file mode 100644 (file)
index b7a301b..0000000
+++ /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),
-        ),
-    ]