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

Rebase migration

parent f24fbc9c
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2 on 2019-12-13 10:28
from django.db import migrations
from arkindex_common.enums import EntityType
from arkindex_common.enums import EntityType, MetaType
from enum import Enum
......@@ -25,6 +24,9 @@ def remove_entity_metatype(apps, schema_editor):
MetaData.objects.filter(type=OldMetaType.Entity, entity__type=EntityType.Date).update(type=OldMetaType.Date)
MetaData.objects.filter(type=OldMetaType.Entity).update(type=OldMetaType.Text)
# Restaure MetaType enum
MetaData._meta.fields[2].enum = MetaType
def add_entity_metatype(apps, schema_editor):
MetaData = apps.get_model('documents', 'MetaData')
......@@ -38,6 +40,9 @@ def add_entity_metatype(apps, schema_editor):
MetaData._meta.fields[2].enum = OldMetaType
MetaData.objects.exclude(entity__isnull=True).update(type=OldMetaType.Entity)
# Restaure MetaType enum
MetaData._meta.fields[2].enum = MetaType
class Migration(migrations.Migration):
......
......@@ -38,7 +38,7 @@ def reverse_migration(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
('documents', '0029_allowedmetadata'),
('documents', '0031_remove_entity_metatype'),
]
operations = [
......
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