# Generated by Django 3.2.9 on 2022-10-15 21:40

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import opencontractserver.annotations.models
import opencontractserver.shared.defaults
import opencontractserver.shared.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Annotation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('backend_lock', models.BooleanField(default=False)),
                ('page', models.IntegerField(default=1)),
                ('raw_text', models.TextField(blank=True, null=True)),
                ('tokens_jsons', opencontractserver.shared.fields.NullableJSONField(default=opencontractserver.shared.defaults.jsonfield_empty_array)),
                ('bounding_box', opencontractserver.shared.fields.NullableJSONField(default=opencontractserver.shared.defaults.empty_bounding_box)),
                ('json', opencontractserver.shared.fields.NullableJSONField(default=opencontractserver.shared.defaults.jsonfield_default_value)),
                ('is_public', models.BooleanField(default=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Creation Date and Time')),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
            ],
            options={
                'permissions': (('permission_annotation', 'permission annotation'), ('create_annotation', 'create annotation'), ('read_annotation', 'read annotation'), ('update_annotation', 'update annotation'), ('remove_annotation', 'delete annotation'), ('publish_annotation', 'publish relationship')),
            },
        ),
        migrations.CreateModel(
            name='AnnotationGroupObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AnnotationLabel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('backend_lock', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('label_type', models.CharField(choices=[('RELATIONSHIP_LABEL', 'Relationship label.'), ('DOC_TYPE_LABEL', 'Document-level type label.'), ('TOKEN_LABEL', 'Token-level labels for Funsd and NER labeling')], default='TOKEN_LABEL', max_length=128)),
                ('color', models.CharField(default='#ffff00', max_length=12)),
                ('description', models.TextField(default='')),
                ('icon', models.CharField(default='tags', max_length=128)),
                ('text', models.CharField(default='Text Label', max_length=128)),
                ('is_public', models.BooleanField(default=False)),
            ],
            options={
                'permissions': (('permission_annotationlabel', 'permission Annotationlabel'), ('publish_annotationlabel', 'publish Annotationlabel'), ('create_annotationlabel', 'create Annotationlabel'), ('read_annotationlabel', 'read Annotationlabel'), ('update_annotationlabel', 'update Annotationlabel'), ('remove_annotationlabel', 'delete Annotationlabel')),
            },
        ),
        migrations.CreateModel(
            name='AnnotationLabelGroupObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AnnotationLabelUserObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AnnotationUserObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LabelSet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('backend_lock', models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(db_index=True, max_length=1024)),
                ('description', models.TextField(default='')),
                ('icon', models.FileField(blank=True, upload_to=opencontractserver.annotations.models.calculate_labelset_icon_path)),
            ],
            options={
                'permissions': (('permission_labelset', 'Can permission labelset'), ('publish_labelset', 'Can publish labelset'), ('create_labelset', 'Can create labelset'), ('read_labelset', 'Can read labelset'), ('update_labelset', 'Can update labelset'), ('remove_labelset', 'Can delete labelset')),
            },
        ),
        migrations.CreateModel(
            name='LabelSetGroupObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LabelSetUserObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Relationship',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('backend_lock', models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Creation Date and Time')),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
            ],
            options={
                'permissions': (('permission_relationship', 'permission relationship'), ('create_relationship', 'create relationship'), ('read_relationship', 'read relationship'), ('update_relationship', 'update relationship'), ('remove_relationship', 'delete relationship'), ('publish_relationship', 'publish relationship')),
            },
        ),
        migrations.CreateModel(
            name='RelationshipGroupObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='RelationshipUserObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='annotations.relationship')),
                ('permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.permission')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
