Commit 3a426e91 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes unbound models migration.

parent 937d4ea5
# Generated by Django 2.2.19 on 2021-03-24 10:16
from django.db import migrations, models
import django.db.models.deletion
def forward(apps, se):
# delete any unbound model
OcrModel = apps.get_model('core', 'OcrModel')
OcrModel.objects.filter(document__isnull=True).delete()
def backward(apps, se):
pass
class Migration(migrations.Migration):
dependencies = [
('core', '0042_auto_20201009_1015'),
]
operations = [
migrations.RunPython(forward, backward),
migrations.AlterField(
model_name='ocrmodel',
name='document',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='ocr_models', to='core.Document'),
),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment