mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 10:37:16 +01:00
Made migrations compatible with new user model when creating from scratch.
This commit is contained in:
parent
3c496af6ad
commit
89aebfc13f
59 changed files with 819 additions and 207 deletions
|
|
@ -5,6 +5,17 @@ from south.v2 import SchemaMigration
|
|||
from django.db import models
|
||||
|
||||
|
||||
try:
|
||||
from django.contrib.auth import get_user_model
|
||||
except ImportError: # django < 1.5
|
||||
from django.contrib.auth.models import User
|
||||
else:
|
||||
User = get_user_model()
|
||||
|
||||
user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name)
|
||||
user_model_label = '%s.%s' % (User._meta.app_label, User._meta.module_name)
|
||||
user_ptr_name = '%s_ptr' % User._meta.object_name.lower()
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
|
|
@ -50,8 +61,8 @@ class Migration(SchemaMigration):
|
|||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
u'auth.user': {
|
||||
'Meta': {'object_name': 'User'},
|
||||
user_model_label: {
|
||||
'Meta': {'object_name': User.__name__, 'db_table': "'%s'" % User._meta.db_table},
|
||||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
|
|
@ -100,7 +111,7 @@ class Migration(SchemaMigration):
|
|||
'db_permissions': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
|
||||
'db_typeclass_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'unique': 'True'})
|
||||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['%s']" % user_orm_label, 'unique': 'True'})
|
||||
},
|
||||
u'scripts.scriptdb': {
|
||||
'Meta': {'object_name': 'ScriptDB'},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue