diff mbox

[09/10] Add delegate to migrations

Message ID 1448712886-3221-10-git-send-email-mchehab@osg.samsung.com
State Rejected
Delegated to: Stephen Finucane
Headers show

Commit Message

Mauro Carvalho Chehab Nov. 28, 2015, 12:14 p.m. UTC
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 patchwork/migrations/0001_initial.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Stephen Finucane Jan. 6, 2016, 5:23 p.m. UTC | #1
On 28 Nov 10:14, Mauro Carvalho Chehab wrote:
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Generally when you create these, you should create a new migration
for each change. You can do this like so:

    ./manage.py makemigrations

They're effortless to apply (assuming using Django > 1.6) so while it
is possible to squeeze migrations I don't think we have a good reason
to do so here.

I'll just include the autogenerated one as part of patch one, if that's
OK?

Stephen
diff mbox

Patch

diff --git a/patchwork/migrations/0001_initial.py b/patchwork/migrations/0001_initial.py
index 65d1c3556414..5b71f3ef5385 100644
--- a/patchwork/migrations/0001_initial.py
+++ b/patchwork/migrations/0001_initial.py
@@ -165,6 +165,30 @@  class Migration(migrations.Migration):
                 ('orig_state', models.ForeignKey(to='patchwork.State')),
             ],
         ),
+        migrations.CreateModel(
+            name='DelegationRule',
+            fields=[
+                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+                ('path', models.CharField(max_length=255, validators=[patchwork.models.validate_rule_path])),
+                ('priority', models.IntegerField(default=0)),
+                ('project', models.ForeignKey(to='patchwork.Project')),
+                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
+            ],
+            options={
+                'ordering': ['-priority', 'path'],
+            },
+            bases=(models.Model,),
+        ),
+        migrations.AlterUniqueTogether(
+            name='delegationrule',
+            unique_together=set([('path', 'project')]),
+        ),
+        migrations.AlterField(
+            model_name='patch',
+            name='state',
+            field=models.ForeignKey(default=patchwork.models.get_default_initial_patch_state, to='patchwork.State'),
+            preserve_default=True,
+        ),
         migrations.AddField(
             model_name='patchtag',
             name='patch',