<gh_stars>0
# Generated by Django 2.0.4 on 2018-04-13 05:10

from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='IUCNStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, choices=[('LC', 'Least Concern'), ('NT', 'Near Threatened'), ('VU', 'Vulnerable'), ('EN', 'Endangered'), ('CR', 'Critically Endangered'), ('EW', 'Extinct In The Wild'), ('EX', 'Extinct')], default='', max_length=50)),
                ('sensitive', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'IUCN Status',
                'verbose_name_plural': 'IUCN Status',
            },
        ),
        migrations.CreateModel(
            name='LocationContext',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('context_document', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='LocationSite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('geometry_point', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('geometry_line', django.contrib.gis.db.models.fields.LineStringField(blank=True, null=True, srid=4326)),
                ('geometry_polygon', django.contrib.gis.db.models.fields.PolygonField(blank=True, null=True, srid=4326)),
                ('geometry_multipolygon', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, null=True, srid=4326)),
                ('location_context', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bims.LocationContext')),
            ],
        ),
        migrations.CreateModel(
            name='LocationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True, null=True)),
                ('allowed_geometry', models.CharField(choices=[('POINT', 'Point'), ('LINE', 'Line'), ('POLYGON', 'Polygon'), ('MULTIPOLYGON', 'Multipolygon')], max_length=20)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qualifications', models.CharField(blank=True, default='', max_length=250)),
                ('other', models.CharField(blank=True, default='', max_length=100)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(default=django.utils.timezone.now)),
                ('sites', models.ManyToManyField(to='bims.LocationSite')),
            ],
        ),
        migrations.CreateModel(
            name='Taxon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gbif_id', models.IntegerField(blank=True, null=True, verbose_name='GBIF id')),
                ('common_name', models.CharField(blank=True, default='', max_length=100)),
                ('scientific_name', models.CharField(blank=True, default='', max_length=100)),
                ('author', models.CharField(blank=True, default='', max_length=100)),
                ('iucn_status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bims.IUCNStatus')),
            ],
            options={
                'verbose_name': 'Taxon',
                'verbose_name_plural': 'Taxa',
            },
        ),
        migrations.AddField(
            model_name='locationsite',
            name='location_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bims.LocationType'),
        ),
    ]

# Generated by Django 2.0.4 on 2018-04-13 05:10

from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='IUCNStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, choices=[('LC', 'Least Concern'), ('NT', 'Near Threatened'), ('VU', 'Vulnerable'), ('EN', 'Endangered'), ('CR', 'Critically Endangered'), ('EW', 'Extinct In The Wild'), ('EX', 'Extinct')], default='', max_length=50)),
                ('sensitive', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'IUCN Status',
                'verbose_name_plural': 'IUCN Status',
            },
        ),
        migrations.CreateModel(
            name='LocationContext',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('context_document', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='LocationSite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('geometry_point', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('geometry_line', django.contrib.gis.db.models.fields.LineStringField(blank=True, null=True, srid=4326)),
                ('geometry_polygon', django.contrib.gis.db.models.fields.PolygonField(blank=True, null=True, srid=4326)),
                ('geometry_multipolygon', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, null=True, srid=4326)),
                ('location_context', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bims.LocationContext')),
            ],
        ),
        migrations.CreateModel(
            name='LocationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True, null=True)),
                ('allowed_geometry', models.CharField(choices=[('POINT', 'Point'), ('LINE', 'Line'), ('POLYGON', 'Polygon'), ('MULTIPOLYGON', 'Multipolygon')], max_length=20)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qualifications', models.CharField(blank=True, default='', max_length=250)),
                ('other', models.CharField(blank=True, default='', max_length=100)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(default=django.utils.timezone.now)),
                ('sites', models.ManyToManyField(to='bims.LocationSite')),
            ],
        ),
        migrations.CreateModel(
            name='Taxon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gbif_id', models.IntegerField(blank=True, null=True, verbose_name='GBIF id')),
                ('common_name', models.CharField(blank=True, default='', max_length=100)),
                ('scientific_name', models.CharField(blank=True, default='', max_length=100)),
                ('author', models.CharField(blank=True, default='', max_length=100)),
                ('iucn_status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bims.IUCNStatus')),
            ],
            options={
                'verbose_name': 'Taxon',
                'verbose_name_plural': 'Taxa',
            },
        ),
        migrations.AddField(
            model_name='locationsite',
            name='location_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bims.LocationType'),
        ),
    ]
# Generated by Django 2.0.4 on 2018-04-13 05:10