Skip to content
Snippets Groups Projects
Commit 9e0138ab authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Migrate structure metadata

parent 299364ff
No related branches found
No related tags found
No related merge requests found
from django.db import migrations
from arkindex_common.enums import MetaType
def structure_metadata(apps, schema_editor):
"""
Update reference
"""
MetaData = apps.get_model('documents', 'MetaData')
MetaData.objects.filter(name='Reference').update(type=MetaType.Structure)
def reverse_migration(apps, schema_editor):
MetaData = apps.get_model('documents', 'MetaData')
MetaData.objects.filter(type=MetaType.Structure).update(type=MetaType.Text)
class Migration(migrations.Migration):
dependencies = [
('documents', '0027_classification_best'),
]
operations = [
migrations.RunPython(structure_metadata, reverse_migration)
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment