Source

incuna-mailer / mailer / migrations / 0003_auto__add_schedule__add_field_messagetemplate_schedule.py

Full commit
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        
        # Adding model 'Schedule'
        db.create_table('mailer_schedule', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('frequency', self.gf('django.db.models.fields.IntegerField')(default=1, max_length=15)),
            ('number', self.gf('django.db.models.fields.IntegerField')(default=1)),
            ('interval', self.gf('django.db.models.fields.IntegerField')(default=1, null=True, blank=True)),
        ))
        db.send_create_signal('mailer', ['Schedule'])

        # Adding field 'MessageTemplate.schedule'
        db.add_column('mailer_messagetemplate', 'schedule', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['mailer.Schedule']), keep_default=False)


    def backwards(self, orm):
        
        # Deleting model 'Schedule'
        db.delete_table('mailer_schedule')

        # Deleting field 'MessageTemplate.schedule'
        db.delete_column('mailer_messagetemplate', 'schedule_id')


    models = {
        'mailer.messagetemplate': {
            'Meta': {'object_name': 'MessageTemplate'},
            'body': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'from_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
            'from_name': ('django.db.models.fields.CharField', [], {'max_length': '127', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '127'}),
            'schedule': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['mailer.Schedule']"}),
            'subject': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'template_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
        },
        'mailer.schedule': {
            'Meta': {'object_name': 'Schedule'},
            'frequency': ('django.db.models.fields.IntegerField', [], {'default': '1', 'max_length': '15'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'interval': ('django.db.models.fields.IntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
            'number': ('django.db.models.fields.IntegerField', [], {'default': '1'})
        }
    }

    complete_apps = ['mailer']