Skip to content
Snippets Groups Projects
Commit 38376019 authored by Valentin Rigal's avatar Valentin Rigal Committed by Erwan Rouchet
Browse files

Migrate structure metadata

parent 47bc06e2
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