Пример #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('datasets', '0010_auto_20200111_1723'),
    ]

    operations = [
        migrations.AlterField(
            model_name='datasetuser',
            name='user_id',
            field=models.ForeignKey(
                default=-1,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='users',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='DatasetFile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rev', models.IntegerField(blank=True, null=True)),
                ('file',
                 models.FileField(
                     upload_to=datasets.models.user_directory_path)),
                ('uri_base',
                 models.URLField(blank=True,
                                 default='http://whgazetteer.org/api/places/',
                                 null=True)),
                ('format',
                 models.CharField(choices=[('lpf', 'Linked Places v1.0'),
                                           ('delimited', 'LP-TSV')],
                                  default='lpf',
                                  max_length=12)),
                ('datatype',
                 models.CharField(choices=[('place', 'Places'),
                                           ('anno', 'Traces')],
                                  default='place',
                                  max_length=12)),
                ('delimiter',
                 models.CharField(blank=True, max_length=5, null=True)),
                ('status',
                 models.CharField(blank=True,
                                  choices=[('format_error', 'Invalid format'),
                                           ('format_ok', 'Valid format'),
                                           ('in_database',
                                            'Inserted to database'),
                                           ('uploaded', 'File uploaded'),
                                           ('ready', 'Ready for submittal'),
                                           ('accessioned', 'Accessioned')],
                                  max_length=12,
                                  null=True)),
                ('upload_date',
                 models.DateTimeField(auto_now_add=True, null=True)),
                ('accepted_date', models.DateTimeField(null=True)),
                ('header',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(max_length=30),
                     blank=True,
                     null=True,
                     size=None)),
                ('numrows', models.IntegerField(blank=True, null=True)),
                ('dataset_id',
                 models.ForeignKey(default=-1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='files',
                                   to='datasets.Dataset')),
            ],
            options={
                'db_table': 'dataset_file',
                'managed': True,
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('datasets', '0002_auto_20200430_0314'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='datasetcolumns',
            name='dataset_id',
        ),
        migrations.RemoveField(
            model_name='datasetdata',
            name='dataset_id',
        ),
        migrations.RemoveField(
            model_name='datasetqueueerrors',
            name='dataset_queue_id',
        ),
        migrations.RemoveField(
            model_name='datasetqueues',
            name='uploaded_by',
        ),
        migrations.RemoveField(
            model_name='datasets',
            name='dataset_queue_id',
        ),
        migrations.AddField(
            model_name='datasetcolumns',
            name='dataset',
            field=models.ForeignKey(
                blank=True,
                db_column='dataset_id',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='datasets.Datasets'),
        ),
        migrations.AddField(
            model_name='datasetdata',
            name='dataset',
            field=models.ForeignKey(
                blank=True,
                db_column='dataset_id',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='datasets.Datasets'),
        ),
        migrations.AddField(
            model_name='datasetqueueerrors',
            name='dataset_queue',
            field=models.ForeignKey(
                blank=True,
                db_column='dataset_queue_id',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='datasets.DatasetQueues'),
        ),
        migrations.AddField(
            model_name='datasetqueues',
            name='name',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AddField(
            model_name='datasetqueues',
            name='uploader',
            field=models.ForeignKey(
                blank=True,
                db_column='uploaded_by',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='uploader',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='datasets',
            name='dataset_queue',
            field=models.ForeignKey(
                blank=True,
                db_column='dataset_queue_id',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='dataset_queue',
                to='datasets.DatasetQueues'),
        ),
        migrations.AlterField(
            model_name='datasetqueues',
            name='sourcefile',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=datasets.models.DatasetUploadPath()),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=20, unique='True')),
                ('name', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=2044)),
                ('file', models.FileField(upload_to=datasets.models.user_directory_path)),
                ('uri_base', models.URLField(blank=True, null=True)),
                ('format', models.CharField(choices=[('delimited', 'Delimited'), ('lpf', 'Linked Places (GeoJSON-LDT)'), ('direct', 'Inserted to db directly')], default='delimited', max_length=12)),
                ('datatype', models.CharField(choices=[('place', 'Places'), ('anno', 'Annotations'), ('source', 'Sources')], default='place', max_length=12)),
                ('delimiter', models.CharField(blank=True, max_length=5, null=True)),
                ('status', models.CharField(blank=True, choices=[('format_error', 'Invalid format'), ('format_ok', 'Valid format'), ('in_database', 'Inserted to database'), ('uploaded', 'File uploaded'), ('ready', 'Ready for submittal'), ('accepted', 'Accepted')], max_length=12, null=True)),
                ('upload_date', models.DateTimeField(auto_now_add=True, null=True)),
                ('accepted_date', models.DateTimeField(null=True)),
                ('spine', models.BooleanField(default=False)),
                ('mapbox_id', models.CharField(blank=True, max_length=200, null=True)),
                ('header', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), blank=True, null=True, size=None)),
                ('numrows', models.IntegerField(blank=True, null=True)),
                ('numlinked', models.IntegerField(blank=True, null=True)),
                ('total_links', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'datasets',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Hit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task_id', models.CharField(max_length=50)),
                ('authority', models.CharField(choices=[('tgn', 'Getty TGN'), ('dbp', 'DBpedia'), ('gn', 'Geonames'), ('wd', 'Wikidata'), ('spine', 'WHG Spine')], max_length=12)),
                ('query_pass', models.CharField(choices=[('tgn', 'Getty TGN'), ('dbp', 'DBpedia'), ('gn', 'Geonames'), ('wd', 'Wikidata'), ('spine', 'WHG Spine')], max_length=12)),
                ('src_id', models.CharField(max_length=50)),
                ('score', models.FloatField()),
                ('reviewed', models.BooleanField(default=False)),
                ('authrecord_id', models.CharField(max_length=255)),
                ('json', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('geom', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('dataset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datasets.Dataset')),
            ],
            options={
                'db_table': 'hits',
                'managed': True,
            },
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('sharing',
                 models.CharField(
                     choices=[('PRIVATE', 'private'), ('PUBLIC', 'public')],
                     default=datasets.models.SharingMode('public'),
                     max_length=7)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('separator', models.CharField(default='_', max_length=5)),
                ('parent1', models.CharField(max_length=200)),
                ('parent2', models.CharField(max_length=200)),
                ('gen_type',
                 models.CharField(blank=True,
                                  choices=[('CLEAN_LINE', 'clean line'),
                                           ('HYBRID', 'hybrid')],
                                  max_length=10)),
                ('generation', models.PositiveSmallIntegerField()),
                ('place',
                 models.CharField(blank=True,
                                  choices=[('FIELD', 'field'),
                                           ('GREENHOUSE', 'greenhouse'),
                                           ('PLANT_CHAMBER', 'plant chamber')],
                                  max_length=13)),
                ('watering',
                 models.CharField(blank=True,
                                  choices=[('WATERING', 'watering'),
                                           ('DROUGHT', 'drought')],
                                  max_length=8)),
                ('repetition', models.PositiveIntegerField()),
                ('vegetation_date', models.DateField()),
                ('custom_fields',
                 django.contrib.postgres.fields.jsonb.JSONField()),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=255)),
                ('file', models.FileField(upload_to='images/')),
                ('date_uploaded', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.AddField(
            model_name='dataset',
            name='images',
            field=models.ManyToManyField(to='datasets.Image'),
        ),
        migrations.AddField(
            model_name='dataset',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ColumnType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('_sid', models.CharField(choices=[('name', 'Full name'), ('job', 'Job'), ('text', 'Text'), ('integer', 'Integer'), ('date', 'Date')], max_length=20, unique=True)),
            ],
            options={
                'db_table': 'column_types',
            },
        ),
        migrations.CreateModel(
            name='DataSchema',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=250)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('separator', models.CharField(help_text='Line separator', max_length=3)),
                ('string_character', models.CharField(help_text='A single character used for quoting', max_length=1)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'schemas',
            },
        ),
        migrations.CreateModel(
            name='DataSet',
            fields=[
                ('id', models.CharField(default=datasets.models.get_id, max_length=32, primary_key=True, serialize=False)),
                ('rows', models.PositiveIntegerField()),
                ('processed', models.BooleanField(default=False, help_text='Dataset processing status')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('schema', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datasets.dataschema')),
            ],
            options={
                'db_table': 'datasets',
            },
        ),
        migrations.CreateModel(
            name='Column',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('order', models.PositiveIntegerField(db_index=True)),
                ('params', models.JSONField(blank=True, help_text='Column additional params for data generation', null=True)),
                ('schema', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', to='datasets.dataschema')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datasets.columntype')),
            ],
            options={
                'db_table': 'columns',
            },
        ),
        migrations.CreateModel(
            name='Date',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('datasets.columntype',),
        ),
        migrations.CreateModel(
            name='FullName',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('datasets.columntype',),
        ),
        migrations.CreateModel(
            name='Integer',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('datasets.columntype',),
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('datasets.columntype',),
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('datasets.columntype',),
        ),
    ]