2014-05-18 21:35:00 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from south.utils import datetime_utils as datetime
|
|
|
|
from south.db import db
|
|
|
|
from south.v2 import SchemaMigration
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(SchemaMigration):
|
|
|
|
|
|
|
|
def forwards(self, orm):
|
2014-05-19 22:28:25 +02:00
|
|
|
# Adding model 'MailDomain'
|
|
|
|
db.create_table(u'managemails_maildomain', (
|
|
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
|
|
('domain', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)),
|
|
|
|
))
|
|
|
|
db.send_create_signal(u'managemails', ['MailDomain'])
|
|
|
|
|
2014-05-18 21:35:00 +02:00
|
|
|
# Adding model 'Mailbox'
|
|
|
|
db.create_table(u'managemails_mailbox', (
|
|
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
2014-05-19 22:28:25 +02:00
|
|
|
('username', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)),
|
|
|
|
('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managemails.MailDomain'])),
|
2014-05-18 21:35:00 +02:00
|
|
|
('password', self.gf('django.db.models.fields.CharField')(max_length=64)),
|
|
|
|
('home', self.gf('django.db.models.fields.CharField')(max_length=255)),
|
|
|
|
('uid', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
|
|
|
|
('gid', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
|
|
|
|
('active', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
|
|
))
|
|
|
|
db.send_create_signal(u'managemails', ['Mailbox'])
|
|
|
|
|
2014-05-19 22:28:25 +02:00
|
|
|
# Adding model 'MailAddress'
|
|
|
|
db.create_table(u'managemails_mailaddress', (
|
|
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
|
|
('localpart', self.gf('django.db.models.fields.CharField')(max_length=128)),
|
|
|
|
('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managemails.MailDomain'])),
|
|
|
|
('active', self.gf('django.db.models.fields.BooleanField')(default=True)),
|
|
|
|
))
|
|
|
|
db.send_create_signal(u'managemails', ['MailAddress'])
|
|
|
|
|
|
|
|
# Adding unique constraint on 'MailAddress', fields ['localpart', 'domain']
|
|
|
|
db.create_unique(u'managemails_mailaddress', ['localpart', 'domain_id'])
|
|
|
|
|
|
|
|
# Adding model 'MailAddressMailbox'
|
|
|
|
db.create_table(u'managemails_mailaddressmailbox', (
|
|
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
|
|
('mailaddress', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managemails.MailAddress'])),
|
|
|
|
('mailbox', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managemails.Mailbox'])),
|
|
|
|
))
|
|
|
|
db.send_create_signal(u'managemails', ['MailAddressMailbox'])
|
|
|
|
|
|
|
|
# Adding unique constraint on 'MailAddressMailbox', fields ['mailaddress', 'mailbox']
|
|
|
|
db.create_unique(u'managemails_mailaddressmailbox', ['mailaddress_id', 'mailbox_id'])
|
|
|
|
|
|
|
|
# Adding model 'MailAddressForward'
|
|
|
|
db.create_table(u'managemails_mailaddressforward', (
|
|
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
|
|
('mailaddress', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['managemails.MailAddress'])),
|
|
|
|
('target', self.gf('django.db.models.fields.EmailField')(max_length=254)),
|
|
|
|
))
|
|
|
|
db.send_create_signal(u'managemails', ['MailAddressForward'])
|
|
|
|
|
|
|
|
# Adding unique constraint on 'MailAddressForward', fields ['mailaddress', 'target']
|
|
|
|
db.create_unique(u'managemails_mailaddressforward', ['mailaddress_id', 'target'])
|
|
|
|
|
2014-05-18 21:35:00 +02:00
|
|
|
|
|
|
|
def backwards(self, orm):
|
2014-05-19 22:28:25 +02:00
|
|
|
# Removing unique constraint on 'MailAddressForward', fields ['mailaddress', 'target']
|
|
|
|
db.delete_unique(u'managemails_mailaddressforward', ['mailaddress_id', 'target'])
|
|
|
|
|
|
|
|
# Removing unique constraint on 'MailAddressMailbox', fields ['mailaddress', 'mailbox']
|
|
|
|
db.delete_unique(u'managemails_mailaddressmailbox', ['mailaddress_id', 'mailbox_id'])
|
|
|
|
|
|
|
|
# Removing unique constraint on 'MailAddress', fields ['localpart', 'domain']
|
|
|
|
db.delete_unique(u'managemails_mailaddress', ['localpart', 'domain_id'])
|
|
|
|
|
|
|
|
# Deleting model 'MailDomain'
|
|
|
|
db.delete_table(u'managemails_maildomain')
|
|
|
|
|
2014-05-18 21:35:00 +02:00
|
|
|
# Deleting model 'Mailbox'
|
|
|
|
db.delete_table(u'managemails_mailbox')
|
|
|
|
|
2014-05-19 22:28:25 +02:00
|
|
|
# Deleting model 'MailAddress'
|
|
|
|
db.delete_table(u'managemails_mailaddress')
|
|
|
|
|
|
|
|
# Deleting model 'MailAddressMailbox'
|
|
|
|
db.delete_table(u'managemails_mailaddressmailbox')
|
|
|
|
|
|
|
|
# Deleting model 'MailAddressForward'
|
|
|
|
db.delete_table(u'managemails_mailaddressforward')
|
|
|
|
|
2014-05-18 21:35:00 +02:00
|
|
|
|
|
|
|
models = {
|
2014-05-19 22:28:25 +02:00
|
|
|
u'managemails.mailaddress': {
|
|
|
|
'Meta': {'unique_together': "(('localpart', 'domain'),)", 'object_name': 'MailAddress'},
|
|
|
|
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
|
|
|
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.MailDomain']"}),
|
|
|
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
'localpart': ('django.db.models.fields.CharField', [], {'max_length': '128'})
|
|
|
|
},
|
|
|
|
u'managemails.mailaddressforward': {
|
|
|
|
'Meta': {'unique_together': "(('mailaddress', 'target'),)", 'object_name': 'MailAddressForward'},
|
|
|
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
'mailaddress': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.MailAddress']"}),
|
|
|
|
'target': ('django.db.models.fields.EmailField', [], {'max_length': '254'})
|
|
|
|
},
|
|
|
|
u'managemails.mailaddressmailbox': {
|
|
|
|
'Meta': {'unique_together': "(('mailaddress', 'mailbox'),)", 'object_name': 'MailAddressMailbox'},
|
|
|
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
'mailaddress': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.MailAddress']"}),
|
|
|
|
'mailbox': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.Mailbox']"})
|
|
|
|
},
|
2014-05-18 21:35:00 +02:00
|
|
|
u'managemails.mailbox': {
|
|
|
|
'Meta': {'object_name': 'Mailbox'},
|
|
|
|
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
2014-05-19 22:28:25 +02:00
|
|
|
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.MailDomain']"}),
|
2014-05-18 21:35:00 +02:00
|
|
|
'gid': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
|
|
|
|
'home': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
|
|
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
|
|
|
'password': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
|
|
|
|
'uid': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
|
2014-05-19 22:28:25 +02:00
|
|
|
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
|
|
|
|
},
|
|
|
|
u'managemails.maildomain': {
|
|
|
|
'Meta': {'object_name': 'MailDomain'},
|
|
|
|
'domain': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
|
|
|
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
|
2014-05-18 21:35:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
complete_apps = ['managemails']
|