2013-06-06 01:03:16 -07:00
|
|
|
import datetime
|
|
|
|
|
from south.db import db
|
|
|
|
|
from south.v2 import SchemaMigration
|
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(SchemaMigration):
|
2013-11-25 21:13:32 +01:00
|
|
|
no_dry_run = True
|
2013-06-06 01:03:16 -07:00
|
|
|
def forwards(self, orm):
|
|
|
|
|
for message in orm['django_mailbox.Message'].objects.all():
|
2013-06-11 22:23:27 -07:00
|
|
|
for attachment in message.attachments.all():
|
2013-06-06 01:03:16 -07:00
|
|
|
attachment.message = message
|
|
|
|
|
attachment.save()
|
|
|
|
|
|
|
|
|
|
def backwards(self, orm):
|
|
|
|
|
for attachment in orm['django_mailbox.MessageAttachment'].objects.all():
|
|
|
|
|
if attachment.message:
|
2013-06-11 22:23:27 -07:00
|
|
|
attachment.message.attachments.add(
|
2013-06-06 01:03:16 -07:00
|
|
|
attachment
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
models = {
|
2019-10-15 05:31:13 +02:00
|
|
|
'django_mailbox.mailbox': {
|
2013-06-06 01:03:16 -07:00
|
|
|
'Meta': {'object_name': 'Mailbox'},
|
|
|
|
|
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
|
|
|
|
'from_email': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
2019-10-15 05:31:13 +02:00
|
|
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
2013-06-06 01:03:16 -07:00
|
|
|
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
|
|
|
|
'uri': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'})
|
|
|
|
|
},
|
2019-10-15 05:31:13 +02:00
|
|
|
'django_mailbox.message': {
|
2013-06-06 01:03:16 -07:00
|
|
|
'Meta': {'object_name': 'Message'},
|
2019-10-15 05:31:13 +02:00
|
|
|
'attachments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'messages_old'", 'blank': 'True', 'to': "orm['django_mailbox.MessageAttachment']"}),
|
2013-06-06 01:03:16 -07:00
|
|
|
'body': ('django.db.models.fields.TextField', [], {}),
|
|
|
|
|
'from_header': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
2019-10-15 05:31:13 +02:00
|
|
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
|
'in_reply_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'replies'", 'null': 'True', 'to': "orm['django_mailbox.Message']"}),
|
|
|
|
|
'mailbox': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messages'", 'to': "orm['django_mailbox.Mailbox']"}),
|
2013-06-06 01:03:16 -07:00
|
|
|
'message_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
|
|
|
|
'outgoing': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
|
|
|
|
'processed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
|
|
|
|
'read': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
|
|
|
|
|
'subject': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
|
|
|
|
'to_header': ('django.db.models.fields.TextField', [], {})
|
|
|
|
|
},
|
2019-10-15 05:31:13 +02:00
|
|
|
'django_mailbox.messageattachment': {
|
2013-06-06 01:03:16 -07:00
|
|
|
'Meta': {'object_name': 'MessageAttachment'},
|
|
|
|
|
'document': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
|
2019-10-15 05:31:13 +02:00
|
|
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
|
'message': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attachments_new'", 'null': 'True', 'to': "orm['django_mailbox.Message']"})
|
2013-06-06 01:03:16 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
complete_apps = ['django_mailbox']
|