0001_initial.py 6.09 KB
Newer Older
1
# -*- coding: utf-8 -*-
Nicolas Noé's avatar
Nicolas Noé committed
2
# Generated by Django 1.11.2 on 2017-06-22 09:08
3 4
from __future__ import unicode_literals

5 6
import django.contrib.gis.db.models.fields
import django.contrib.postgres.fields.ranges
7
from django.db import migrations, models
Nicolas Noé's avatar
Nicolas Noé committed
8
import django.db.models.deletion
Nicolas Noé's avatar
Nicolas Noé committed
9
import mptt.fields
10 11 12 13 14 15 16 17 18 19


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
20 21 22 23 24 25 26
        migrations.CreateModel(
            name='Expedition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
27 28 29 30 31 32 33
        migrations.CreateModel(
            name='Fixation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
Nicolas Noé's avatar
Nicolas Noé committed
34 35 36 37 38 39 40
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=100)),
                ('last_name', models.CharField(max_length=100)),
            ],
41 42 43
            options={
                'verbose_name_plural': 'people',
            },
Nicolas Noé's avatar
Nicolas Noé committed
44
        ),
45 46 47 48
        migrations.CreateModel(
            name='Specimen',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
Nicolas Noé's avatar
Nicolas Noé committed
49 50
                ('specimen_id', models.IntegerField(unique=True)),
                ('scientific_name', models.CharField(max_length=100)),
51 52
                ('coords', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326, verbose_name='Coordinates')),
                ('depth', django.contrib.postgres.fields.ranges.FloatRangeField(blank=True, help_text='Unit: meters.', null=True)),
Nicolas Noé's avatar
Nicolas Noé committed
53
                ('comment', models.TextField(blank=True, null=True)),
54
                ('fixation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='specimens.Fixation')),
55
                ('identified_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Person')),
Nicolas Noé's avatar
Nicolas Noé committed
56 57 58 59 60 61 62
            ],
        ),
        migrations.CreateModel(
            name='SpecimenLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
63 64
            ],
        ),
65 66 67 68 69 70 71 72 73
        migrations.CreateModel(
            name='SpecimenPicture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='specimen_pictures')),
                ('high_interest', models.BooleanField(verbose_name='High resolution/species representative')),
                ('specimen', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Specimen')),
            ],
        ),
74 75 76 77 78 79 80 81
        migrations.CreateModel(
            name='Station',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('expedition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Expedition')),
            ],
        ),
Nicolas Noé's avatar
Nicolas Noé committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
        migrations.CreateModel(
            name='Taxon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('aphia_id', models.IntegerField(blank=True, null=True)),
                ('authority', models.CharField(blank=True, max_length=100, null=True)),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='specimens.Taxon')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaxonRank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='TaxonStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.AddField(
            model_name='taxon',
            name='rank',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.TaxonRank'),
        ),
        migrations.AddField(
            model_name='taxon',
            name='status',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='specimens.TaxonStatus'),
        ),
Nicolas Noé's avatar
Nicolas Noé committed
123 124
        migrations.AddField(
            model_name='specimen',
125
            name='specimen_location',
Nicolas Noé's avatar
Nicolas Noé committed
126 127
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.SpecimenLocation'),
        ),
128 129 130 131 132
        migrations.AddField(
            model_name='specimen',
            name='station',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Station'),
        ),
Nicolas Noé's avatar
Nicolas Noé committed
133 134 135 136
        migrations.AlterUniqueTogether(
            name='person',
            unique_together=set([('first_name', 'last_name')]),
        ),
137
    ]