Rename migration to indicate slowness - may need to drop migration table and --fake run again.
This commit is contained in:
parent
9837835e9e
commit
f6b4155aed
5 changed files with 5 additions and 13 deletions
|
|
@ -8,10 +8,9 @@ from django.db import migrations
|
||||||
def forwards(apps, schema_editor):
|
def forwards(apps, schema_editor):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
apps.get_model('accounts', 'AccountDB')
|
AccountDB = apps.get_model('accounts', 'AccountDB')
|
||||||
except LookupError:
|
except LookupError:
|
||||||
return
|
return
|
||||||
AccountDB = apps.get_model('accounts', 'AccountDB')
|
|
||||||
|
|
||||||
Msg = apps.get_model('comms', 'Msg')
|
Msg = apps.get_model('comms', 'Msg')
|
||||||
for msg in Msg.objects.all():
|
for msg in Msg.objects.all():
|
||||||
|
|
@ -18,7 +18,7 @@ def _table_exists(db_cursor, tablename):
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('comms', '0014_auto_20170705_1736'),
|
('comms', '0014_convert_msgs_may_be_slow'),
|
||||||
]
|
]
|
||||||
|
|
||||||
db_cursor = connection.cursor()
|
db_cursor = connection.cursor()
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ def update_perms_and_locks(apps, schema_editor):
|
||||||
|
|
||||||
def _sub(match):
|
def _sub(match):
|
||||||
perm = match.group(1)
|
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:
|
for app_tuple in apps_models:
|
||||||
TClass = apps.get_model(*app_tuple)
|
TClass = apps.get_model(*app_tuple)
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@ def _init_globals():
|
||||||
if not _TO_MODEL_MAP:
|
if not _TO_MODEL_MAP:
|
||||||
_TO_MODEL_MAP = defaultdict(str)
|
_TO_MODEL_MAP = defaultdict(str)
|
||||||
_TO_MODEL_MAP.update(dict((c.natural_key(), c.model_class()) for c in ContentType.objects.all()))
|
_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:
|
if not _SESSION_HANDLER:
|
||||||
from evennia.server.sessionhandler import SESSION_HANDLER as _SESSION_HANDLER
|
from evennia.server.sessionhandler import SESSION_HANDLER as _SESSION_HANDLER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,12 +265,3 @@ class PickledObjectField(models.Field):
|
||||||
# actual lookup, so all we need to do is limit the lookup types.
|
# actual lookup, so all we need to do is limit the lookup types.
|
||||||
return super(PickledObjectField, self).get_db_prep_lookup(
|
return super(PickledObjectField, self).get_db_prep_lookup(
|
||||||
lookup_type, value, connection=connection, prepared=prepared)
|
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"])
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue