0001_initial.py 3.55 KB
Newer Older
1
# -*- coding: utf-8 -*-
2
# Generated by Django 1.11.2 on 2017-06-20 08:54
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='Expedition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
26
27
28
29
30
31
32
        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
33
34
35
36
37
38
39
        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)),
            ],
40
41
42
            options={
                'verbose_name_plural': 'people',
            },
Nicolas Noé's avatar
Nicolas Noé committed
43
        ),
44
45
46
47
        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
48
49
                ('specimen_id', models.IntegerField(unique=True)),
                ('scientific_name', models.CharField(max_length=100)),
50
51
                ('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
52
                ('comment', models.TextField(blank=True, null=True)),
53
                ('fixation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='specimens.Fixation')),
54
                ('identified_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.Person')),
Nicolas Noé's avatar
Nicolas Noé committed
55
56
57
58
59
60
61
            ],
        ),
        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)),
62
63
            ],
        ),
64
65
66
67
68
69
70
71
        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
72
73
        migrations.AddField(
            model_name='specimen',
74
            name='specimen_location',
Nicolas Noé's avatar
Nicolas Noé committed
75
76
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='specimens.SpecimenLocation'),
        ),
77
78
79
80
81
        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
82
83
84
85
        migrations.AlterUniqueTogether(
            name='person',
            unique_together=set([('first_name', 'last_name')]),
        ),
86
    ]