130 lines
No EOL
7.1 KiB
Python
130 lines
No EOL
7.1 KiB
Python
# -*- 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):
|
|
# 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'])
|
|
|
|
# Adding model 'Mailbox'
|
|
db.create_table(u'managemails_mailbox', (
|
|
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
|
('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'])),
|
|
('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'])
|
|
|
|
# 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'])
|
|
|
|
|
|
def backwards(self, orm):
|
|
# 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')
|
|
|
|
# Deleting model 'Mailbox'
|
|
db.delete_table(u'managemails_mailbox')
|
|
|
|
# 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')
|
|
|
|
|
|
models = {
|
|
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']"})
|
|
},
|
|
u'managemails.mailbox': {
|
|
'Meta': {'object_name': 'Mailbox'},
|
|
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
|
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['managemails.MailDomain']"}),
|
|
'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', [], {}),
|
|
'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'})
|
|
}
|
|
}
|
|
|
|
complete_apps = ['managemails'] |