Don't migrate specific binaryfield
This commit is contained in:
parent
0c9d2e053b
commit
79ab75fc90
1 changed files with 1 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ def migrate_serverconf(apps, schema_editor):
|
||||||
"""
|
"""
|
||||||
ServerConfig = apps.get_model("server", "ServerConfig")
|
ServerConfig = apps.get_model("server", "ServerConfig")
|
||||||
for conf in ServerConfig.objects.all():
|
for conf in ServerConfig.objects.all():
|
||||||
value = pickle.loads(utils.to_bytes(conf.db_value))
|
value = pickle.loads(to_bytes(conf.db_value))
|
||||||
conf.db_value2 = value
|
conf.db_value2 = value
|
||||||
conf.save()
|
conf.save()
|
||||||
|
|
||||||
|
|
@ -29,11 +29,6 @@ class Migration(migrations.Migration):
|
||||||
name='db_value2',
|
name='db_value2',
|
||||||
field=evennia.utils.picklefield.PickledObjectField(help_text='The data returned when the config value is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name='value'),
|
field=evennia.utils.picklefield.PickledObjectField(help_text='The data returned when the config value is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name='value'),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
|
||||||
model_name='serverconfig',
|
|
||||||
name='db_value',
|
|
||||||
field=models.BinaryField(blank=True),
|
|
||||||
),
|
|
||||||
# migrate data
|
# migrate data
|
||||||
migrations.RunPython(migrate_serverconf, migrations.RunPython.noop),
|
migrations.RunPython(migrate_serverconf, migrations.RunPython.noop),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue