You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

215 lines
10 KiB

# Generated by Django 2.1.7 on 2019-10-25 16:26
from django.conf import settings
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),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
name='Document',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField()),
('meta', models.TextField(default='{}')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('annotations_approved_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='DocumentAnnotation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('prob', models.FloatField(default=0.0)),
('manual', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='doc_annotations', to='api.Document')),
],
),
migrations.CreateModel(
name='Label',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(max_length=100)),
('prefix_key', models.CharField(blank=True, choices=[('ctrl', 'ctrl'), ('shift', 'shift'), ('ctrl shift', 'ctrl shift')], max_length=10, null=True)),
('suffix_key', models.CharField(blank=True, choices=[('a', 'a'), ('b', 'b'), ('c', 'c'), ('d', 'd'), ('e', 'e'), ('f', 'f'), ('g', 'g'), ('h', 'h'), ('i', 'i'), ('j', 'j'), ('k', 'k'), ('l', 'l'), ('m', 'm'), ('n', 'n'), ('o', 'o'), ('p', 'p'), ('q', 'q'), ('r', 'r'), ('s', 's'), ('t', 't'), ('u', 'u'), ('v', 'v'), ('w', 'w'), ('x', 'x'), ('y', 'y'), ('z', 'z')], max_length=1, null=True)),
('background_color', models.CharField(default='#209cee', max_length=7)),
('text_color', models.CharField(default='#ffffff', max_length=7)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Project',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('description', models.TextField(default='')),
('guideline', models.TextField(default='')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('project_type', models.CharField(choices=[('DocumentClassification', 'document classification'), ('SequenceLabeling', 'sequence labeling'), ('Seq2seq', 'sequence to sequence')], max_length=30)),
('randomize_document_order', models.BooleanField(default=False)),
('collaborative_annotation', models.BooleanField(default=False)),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
),
migrations.CreateModel(
name='Role',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
('description', models.TextField(default='')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='RoleMapping',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Seq2seqAnnotation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('prob', models.FloatField(default=0.0)),
('manual', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('text', models.CharField(max_length=500)),
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq2seq_annotations', to='api.Document')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='SequenceAnnotation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('prob', models.FloatField(default=0.0)),
('manual', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('start_offset', models.IntegerField()),
('end_offset', models.IntegerField()),
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seq_annotations', to='api.Document')),
('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Label')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Seq2seqProject',
fields=[
('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.Project')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('api.project',),
),
migrations.CreateModel(
name='SequenceLabelingProject',
fields=[
('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.Project')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('api.project',),
),
migrations.CreateModel(
name='TextClassificationProject',
fields=[
('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.Project')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('api.project',),
),
migrations.AddField(
model_name='rolemapping',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_mappings', to='api.Project'),
),
migrations.AddField(
model_name='rolemapping',
name='role',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Role'),
),
migrations.AddField(
model_name='rolemapping',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_mappings', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='project',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_api.project_set+', to='contenttypes.ContentType'),
),
migrations.AddField(
model_name='project',
name='users',
field=models.ManyToManyField(related_name='projects', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='label',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='labels', to='api.Project'),
),
migrations.AddField(
model_name='documentannotation',
name='label',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Label'),
),
migrations.AddField(
model_name='documentannotation',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='document',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='api.Project'),
),
migrations.AlterUniqueTogether(
name='sequenceannotation',
unique_together={('document', 'user', 'label', 'start_offset', 'end_offset')},
),
migrations.AlterUniqueTogether(
name='seq2seqannotation',
unique_together={('document', 'user', 'text')},
),
migrations.AlterUniqueTogether(
name='rolemapping',
unique_together={('user', 'project', 'role')},
),
migrations.AlterUniqueTogether(
name='label',
unique_together={('project', 'text')},
),
migrations.AlterUniqueTogether(
name='documentannotation',
unique_together={('document', 'user', 'label')},
),
]