<filename>cadet_app/migrations/0001_initial.py<gh_stars>0
# Generated by Django 3.0 on 2020-01-03 22:00

import cadet_app.models
import colorful.fields
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AnnotationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=220, null=True)),
                ('color', colorful.fields.RGBColorField(blank=True, default='#FF0000', null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(blank=True, max_length=220, null=True)),
                ('value', models.CharField(blank=True, max_length=220, null=True)),
                ('key_shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
                ('value_shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Label',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=220, null=True)),
                ('human_name', models.CharField(blank=True, max_length=220, null=True)),
                ('explain', models.CharField(blank=True, help_text='Explaination of the label and its use', max_length=220, null=True)),
                ('explain_link', models.URLField(blank=True, max_length=1000)),
                ('shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
                ('color', models.CharField(blank=True, max_length=220, null=True)),
                ('attributes', models.ManyToManyField(blank=True, to='cadet_app.Attribute')),
            ],
        ),
        migrations.CreateModel(
            name='LabelGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('explain', models.CharField(blank=True, help_text='Explaination of the label group and its use', max_length=220, null=True)),
                ('labels', models.ManyToManyField(blank=True, to='cadet_app.Label')),
            ],
        ),
        migrations.CreateModel(
            name='LabelSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('group_order', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, null=True, size=None)),
                ('groups', models.ManyToManyField(to='cadet_app.LabelGroup')),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('project_slug', models.SlugField(default=None, max_length=140)),
                ('description', models.TextField(blank=True, null=True)),
                ('language', models.CharField(blank=True, max_length=220, null=True)),
                ('review', models.CharField(choices=[('NR', 'No review required'), ('SR', 'Single required'), ('MR', 'Multiple annotators')], default='NR', max_length=2)),
                ('annotators', models.ManyToManyField(blank=True, related_name='annotators', to=settings.AUTH_USER_MODEL)),
                ('editors', models.ManyToManyField(related_name='editors', to=settings.AUTH_USER_MODEL)),
                ('label_set', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.LabelSet')),
                ('owners', models.ManyToManyField(related_name='owners', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SpacyLanguage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('language', models.TextField(unique=True)),
                ('iso', models.CharField(blank=True, max_length=2, null=True)),
                ('is_core', models.NullBooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('text_slug', models.SlugField(default=None, max_length=140)),
                ('text', models.TextField(blank=True, null=True)),
                ('standoff', models.TextField(blank=True, null=True)),
                ('language', models.CharField(blank=True, max_length=220, null=True)),
                ('source', models.URLField(blank=True, max_length=1000)),
                ('strategic_anno', models.NullBooleanField()),
                ('window_default', models.IntegerField(default=200, help_text='Default number of charachters displayed in the annotation window')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('projects', models.ManyToManyField(blank=True, related_name='text_project', to='cadet_app.Project')),
            ],
        ),
        migrations.AddField(
            model_name='project',
            name='spacy_language',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.SpacyLanguage'),
        ),
        migrations.CreateModel(
            name='Annotation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('annotation_text', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('start_char', models.IntegerField(default=None, null=True)),
                ('end_char', models.IntegerField(default=None, null=True)),
                ('approved', models.BooleanField(default=None, null=True)),
                ('auto_generated', models.BooleanField(default=None, null=True)),
                ('annotation_type', models.ForeignKey(default=cadet_app.models.Annotation.get_token_id, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.AnnotationType')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='annotation_author', to=settings.AUTH_USER_MODEL)),
                ('labels', models.ManyToManyField(blank=True, to='cadet_app.Label')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cadet_app.Project')),
                ('text', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='annotation_text', to='cadet_app.Text')),
            ],
        ),
    ]

<filename>cadet_app/migrations/0001_initial.py<gh_stars>0
# Generated by Django 3.0 on 2020-01-03 22:00

import cadet_app.models
import colorful.fields
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AnnotationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=220, null=True)),
                ('color', colorful.fields.RGBColorField(blank=True, default='#FF0000', null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(blank=True, max_length=220, null=True)),
                ('value', models.CharField(blank=True, max_length=220, null=True)),
                ('key_shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
                ('value_shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Label',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=220, null=True)),
                ('human_name', models.CharField(blank=True, max_length=220, null=True)),
                ('explain', models.CharField(blank=True, help_text='Explaination of the label and its use', max_length=220, null=True)),
                ('explain_link', models.URLField(blank=True, max_length=1000)),
                ('shortcut_key', models.CharField(blank=True, max_length=220, null=True)),
                ('color', models.CharField(blank=True, max_length=220, null=True)),
                ('attributes', models.ManyToManyField(blank=True, to='cadet_app.Attribute')),
            ],
        ),
        migrations.CreateModel(
            name='LabelGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('explain', models.CharField(blank=True, help_text='Explaination of the label group and its use', max_length=220, null=True)),
                ('labels', models.ManyToManyField(blank=True, to='cadet_app.Label')),
            ],
        ),
        migrations.CreateModel(
            name='LabelSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('group_order', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, null=True, size=None)),
                ('groups', models.ManyToManyField(to='cadet_app.LabelGroup')),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('project_slug', models.SlugField(default=None, max_length=140)),
                ('description', models.TextField(blank=True, null=True)),
                ('language', models.CharField(blank=True, max_length=220, null=True)),
                ('review', models.CharField(choices=[('NR', 'No review required'), ('SR', 'Single required'), ('MR', 'Multiple annotators')], default='NR', max_length=2)),
                ('annotators', models.ManyToManyField(blank=True, related_name='annotators', to=settings.AUTH_USER_MODEL)),
                ('editors', models.ManyToManyField(related_name='editors', to=settings.AUTH_USER_MODEL)),
                ('label_set', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.LabelSet')),
                ('owners', models.ManyToManyField(related_name='owners', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SpacyLanguage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('language', models.TextField(unique=True)),
                ('iso', models.CharField(blank=True, max_length=2, null=True)),
                ('is_core', models.NullBooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=220, null=True)),
                ('text_slug', models.SlugField(default=None, max_length=140)),
                ('text', models.TextField(blank=True, null=True)),
                ('standoff', models.TextField(blank=True, null=True)),
                ('language', models.CharField(blank=True, max_length=220, null=True)),
                ('source', models.URLField(blank=True, max_length=1000)),
                ('strategic_anno', models.NullBooleanField()),
                ('window_default', models.IntegerField(default=200, help_text='Default number of charachters displayed in the annotation window')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('projects', models.ManyToManyField(blank=True, related_name='text_project', to='cadet_app.Project')),
            ],
        ),
        migrations.AddField(
            model_name='project',
            name='spacy_language',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.SpacyLanguage'),
        ),
        migrations.CreateModel(
            name='Annotation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('annotation_text', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('start_char', models.IntegerField(default=None, null=True)),
                ('end_char', models.IntegerField(default=None, null=True)),
                ('approved', models.BooleanField(default=None, null=True)),
                ('auto_generated', models.BooleanField(default=None, null=True)),
                ('annotation_type', models.ForeignKey(default=cadet_app.models.Annotation.get_token_id, on_delete=django.db.models.deletion.CASCADE, to='cadet_app.AnnotationType')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='annotation_author', to=settings.AUTH_USER_MODEL)),
                ('labels', models.ManyToManyField(blank=True, to='cadet_app.Label')),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cadet_app.Project')),
                ('text', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='annotation_text', to='cadet_app.Text')),
            ],
        ),
    ]

# Generated by Django 3.0 on 2020-01-03 22:00