0001_initial.py 2.12 KB
Newer Older
1
# -*- coding: utf-8 -*-
2
# Generated by Django 1.11.2 on 2017-06-15 10:51
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 = [
Nicolas Noé's avatar
Nicolas Noé committed
19
20
21
22
23
24
25
26
        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)),
            ],
        ),
27
28
29
30
        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
31
32
                ('specimen_id', models.IntegerField(unique=True)),
                ('scientific_name', models.CharField(max_length=100)),
33
34
                ('coords', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('depth', django.contrib.postgres.fields.ranges.FloatRangeField(blank=True, null=True)),
Nicolas Noé's avatar
Nicolas Noé committed
35
36
37
38
39
40
41
42
43
                ('comment', models.TextField(blank=True, null=True)),
                ('identified_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Person')),
            ],
        ),
        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)),
44
45
            ],
        ),
Nicolas Noé's avatar
Nicolas Noé committed
46
47
        migrations.AddField(
            model_name='specimen',
48
            name='specimen_location',
Nicolas Noé's avatar
Nicolas Noé committed
49
50
51
52
53
54
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.SpecimenLocation'),
        ),
        migrations.AlterUniqueTogether(
            name='person',
            unique_together=set([('first_name', 'last_name')]),
        ),
55
    ]