right-tree/backend/right_tree/api/migrations/0001_initial.py

89 lines
4.4 KiB
Python

# Generated by Django 3.2.8 on 2021-10-15 01:23
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='EcologicalRegion',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50, unique=True)),
],
),
migrations.CreateModel(
name='SoilOrder',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=1, unique=True)),
('name', models.CharField(max_length=50, unique=True)),
],
),
migrations.CreateModel(
name='SoilVariant',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=10, unique=True)),
],
),
migrations.CreateModel(
name='ToleranceLevel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('level', models.CharField(max_length=1)),
],
),
migrations.CreateModel(
name='SoilLayer',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nzsc_class', models.CharField(max_length=4)),
('nzsc_group', models.CharField(max_length=2)),
('shape_leng', models.FloatField()),
('geom', django.contrib.gis.db.models.fields.PolygonField(srid=2193)),
('nzsc_order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.soilorder')),
],
),
migrations.CreateModel(
name='Plant',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50, unique=True)),
('commonname', models.CharField(blank=True, max_length=50, null=True)),
('maxheight', models.FloatField()),
('spacing', models.FloatField()),
('synonym', models.CharField(blank=True, max_length=200, null=True)),
('purpose', models.TextField(blank=True, null=True)),
('stage', models.PositiveIntegerField()),
('growth_form', models.CharField(blank=True, max_length=50, null=True)),
('drought_tolerance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='drought_tolerance', to='api.tolerancelevel')),
('ecological_regions', models.ManyToManyField(to='api.EcologicalRegion')),
('frost_tolerance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='frost_tolerance', to='api.tolerancelevel')),
('salinity_tolerance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='salinity_tolerance', to='api.tolerancelevel')),
('soil_order', models.ManyToManyField(to='api.SoilOrder')),
('soil_variants', models.ManyToManyField(to='api.SoilVariant')),
('water_tolerance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='water_tolerance', to='api.tolerancelevel')),
],
),
migrations.CreateModel(
name='EcologicalDistrictLayer',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ecological', models.CharField(max_length=5)),
('ecologic_1', models.CharField(max_length=50)),
('shape_leng', models.FloatField()),
('shape_area', models.FloatField()),
('geom', django.contrib.gis.db.models.fields.PolygonField(srid=2193)),
('ecologic_2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.ecologicalregion')),
],
),
]