0001_initial.py 2.67 KB
Newer Older
1
# -*- coding: utf-8 -*-
2
# Generated by Django 1.11.2 on 2017-06-16 10:52
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
9
10
11
12
13
14
15
16
17
18


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
19
20
21
22
23
24
25
        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
26
27
28
29
30
31
32
        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)),
            ],
33
34
35
            options={
                'verbose_name_plural': 'people',
            },
Nicolas Noé's avatar
Nicolas Noé committed
36
        ),
37
38
39
40
        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
41
42
                ('specimen_id', models.IntegerField(unique=True)),
                ('scientific_name', models.CharField(max_length=100)),
43
44
                ('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
45
                ('comment', models.TextField(blank=True, null=True)),
46
                ('fixation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='specimens.Fixation')),
47
                ('identified_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Person')),
Nicolas Noé's avatar
Nicolas Noé committed
48
49
50
51
52
53
54
            ],
        ),
        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)),
55
56
            ],
        ),
Nicolas Noé's avatar
Nicolas Noé committed
57
58
        migrations.AddField(
            model_name='specimen',
59
            name='specimen_location',
Nicolas Noé's avatar
Nicolas Noé committed
60
61
62
63
64
65
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.SpecimenLocation'),
        ),
        migrations.AlterUniqueTogether(
            name='person',
            unique_together=set([('first_name', 'last_name')]),
        ),
66
    ]