evennia/evennia/objects/migrations/0008_auto_20170705_1736.py
2017-10-29 13:40:30 -04:00

33 lines
786 B
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-05 17:36
from django.db import migrations
def forwards(apps, schema_editor):
try:
apps.get_model('accounts', 'AccountDB')
except LookupError:
return
AccountDB = apps.get_model('accounts', 'AccountDB')
ObjectDB = apps.get_model('objects', 'ObjectDB')
for object in ObjectDB.objects.all():
account = object.db_account
if account:
account = AccountDB.objects.get(id=account.id)
object.db_account = account
object.save(update_fields=['db_account'])
class Migration(migrations.Migration):
dependencies = [
('objects', '0007_objectdb_db_account'),
]
operations = [
migrations.RunPython(forwards)
]