Rename migration to indicate slowness - may need to drop migration table and --fake run again.

This commit is contained in:
Griatch 2017-09-07 21:27:13 +02:00
parent 9837835e9e
commit f6b4155aed
5 changed files with 5 additions and 13 deletions

View file

@ -8,10 +8,9 @@ from django.db import migrations
def forwards(apps, schema_editor):
try:
apps.get_model('accounts', 'AccountDB')
AccountDB = apps.get_model('accounts', 'AccountDB')
except LookupError:
return
AccountDB = apps.get_model('accounts', 'AccountDB')
Msg = apps.get_model('comms', 'Msg')
for msg in Msg.objects.all():

View file

@ -18,7 +18,7 @@ def _table_exists(db_cursor, tablename):
class Migration(migrations.Migration):
dependencies = [
('comms', '0014_auto_20170705_1736'),
('comms', '0014_convert_msgs_may_be_slow'),
]
db_cursor = connection.cursor()

View file

@ -26,7 +26,7 @@ def update_perms_and_locks(apps, schema_editor):
def _sub(match):
perm = match.group(1)
return perm_map[perm.lower()].capitalize() if perm.lower() in perm_map else perm
return perm_map[perm.lower()].capitalize() if (perm and perm.lower() in perm_map) else perm
for app_tuple in apps_models:
TClass = apps.get_model(*app_tuple)

View file

@ -117,6 +117,8 @@ def _init_globals():
if not _TO_MODEL_MAP:
_TO_MODEL_MAP = defaultdict(str)
_TO_MODEL_MAP.update(dict((c.natural_key(), c.model_class()) for c in ContentType.objects.all()))
# handle old player models by converting them to accounts
_TO_MODEL_MAP[(u"players", u"playerdb")] = _TO_MODEL_MAP[(u"accounts", u"accountdb")]
if not _SESSION_HANDLER:
from evennia.server.sessionhandler import SESSION_HANDLER as _SESSION_HANDLER

View file

@ -265,12 +265,3 @@ class PickledObjectField(models.Field):
# actual lookup, so all we need to do is limit the lookup types.
return super(PickledObjectField, self).get_db_prep_lookup(
lookup_type, value, connection=connection, prepared=prepared)
# South support; see http://south.aeracode.org/docs/tutorial/part4.html#simple-inheritance
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pass
else:
add_introspection_rules([], [r"^evennia\.utils\.picklefield\.PickledObjectField"])