Tweaked Message.msgid and added needed migrations for the field. The first migration creates the new column with NULL values for existing rows, the second adds creation of msgid values by default for new rows.
- Legacy-Id: 12961
This commit is contained in:
parent
119f48699c
commit
60ddd61727
20
ietf/message/migrations/0003_message_msgid.py
Normal file
20
ietf/message/migrations/0003_message_msgid.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-03-03 13:04
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('message', '0002_messageattachment'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='message',
|
||||
name='msgid',
|
||||
field=models.CharField(blank=True, default=None, max_length=255, null=True),
|
||||
),
|
||||
]
|
21
ietf/message/migrations/0004_auto_20170303_1310.py
Normal file
21
ietf/message/migrations/0004_auto_20170303_1310.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-03-03 13:10
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import email.utils
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('message', '0003_message_msgid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='message',
|
||||
name='msgid',
|
||||
field=models.CharField(blank=True, default=email.utils.make_msgid, max_length=255, null=True),
|
||||
),
|
||||
]
|
|
@ -21,7 +21,7 @@ class Message(models.Model):
|
|||
reply_to = models.CharField(max_length=255, blank=True)
|
||||
body = models.TextField()
|
||||
content_type = models.CharField(default="text/plain", max_length=255, blank=True)
|
||||
msgid = models.CharField(max_length=255, blank=True, default=email.utils.make_msgid)
|
||||
msgid = models.CharField(max_length=255, blank=True, null=True, default=email.utils.make_msgid)
|
||||
|
||||
related_groups = models.ManyToManyField(Group, blank=True)
|
||||
related_docs = models.ManyToManyField(Document, blank=True)
|
||||
|
|
Loading…
Reference in a new issue