<filename>backend/api/migrations/0001_initial.py
# Generated by Django 2.1.7 on 2019-03-22 03:14

import datetime
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=200)),
                ('body', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='NpkPerPh',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('min_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('max_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('n_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('p_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('k_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
            ],
        ),
        migrations.CreateModel(
            name='Plant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='PlantLifeCycle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('life_cycle', models.IntegerField(choices=[(0, 'Annual - life shorter than a year'), (1, 'Biennial - life around a year to two years'), (2, 'Perennial - life about more than many years')], default=0)),
            ],
        ),
        migrations.CreateModel(
            name='PlantMoistLvl',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('min_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')], default=0)),
                ('max_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')], default=4)),
            ],
        ),
        migrations.CreateModel(
            name='PlantPh',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('min_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('max_ph', models.DecimalField(decimal_places=2, default=14, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
            ],
        ),
        migrations.CreateModel(
            name='Recommendation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recco_time', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('recco_n_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('recco_p_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('recco_k_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
            ],
        ),
        migrations.CreateModel(
            name='RecommendedPlant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('soil_type_name', models.CharField(default='', max_length=100)),
                ('recco_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Recommendation')),
            ],
        ),
        migrations.CreateModel(
            name='SensorRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('moist', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('ph', models.DecimalField(decimal_places=2, default=7, max_digits=10)),
                ('record_date', models.DateTimeField(default=datetime.datetime.now, null=True)),
                ('record_frequency_min', models.DecimalField(decimal_places=2, default=0.1, max_digits=10, validators=[django.core.validators.MaxValueValidator(10080), django.core.validators.MinValueValidator(0.1)])),
            ],
        ),
        migrations.CreateModel(
            name='SoilProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('location', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='SoilType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('good_for_min_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')])),
                ('good_for_max_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')])),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='soilprofile',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='sensorrecord',
            name='soil_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.SoilProfile'),
        ),
        migrations.AddField(
            model_name='recommendation',
            name='soil_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.SoilProfile'),
        ),
        migrations.AddField(
            model_name='plant',
            name='lifecycle_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantLifeCycle'),
        ),
        migrations.AddField(
            model_name='plant',
            name='moist_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantMoistLvl'),
        ),
        migrations.AddField(
            model_name='plant',
            name='ph_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantPh'),
        ),
    ]

<filename>backend/api/migrations/0001_initial.py
# Generated by Django 2.1.7 on 2019-03-22 03:14

import datetime
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=200)),
                ('body', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='NpkPerPh',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('min_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('max_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('n_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('p_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('k_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
            ],
        ),
        migrations.CreateModel(
            name='Plant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='PlantLifeCycle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('life_cycle', models.IntegerField(choices=[(0, 'Annual - life shorter than a year'), (1, 'Biennial - life around a year to two years'), (2, 'Perennial - life about more than many years')], default=0)),
            ],
        ),
        migrations.CreateModel(
            name='PlantMoistLvl',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('min_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')], default=0)),
                ('max_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')], default=4)),
            ],
        ),
        migrations.CreateModel(
            name='PlantPh',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('min_ph', models.DecimalField(decimal_places=2, default=0, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
                ('max_ph', models.DecimalField(decimal_places=2, default=14, max_digits=10, validators=[django.core.validators.MaxValueValidator(14), django.core.validators.MinValueValidator(0)])),
            ],
        ),
        migrations.CreateModel(
            name='Recommendation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recco_time', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('recco_n_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('recco_p_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
                ('recco_k_lvl', models.IntegerField(choices=[(1, 'Low'), (2, 'Medium'), (3, 'High')])),
            ],
        ),
        migrations.CreateModel(
            name='RecommendedPlant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('plant_name', models.CharField(default='', max_length=100)),
                ('soil_type_name', models.CharField(default='', max_length=100)),
                ('recco_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Recommendation')),
            ],
        ),
        migrations.CreateModel(
            name='SensorRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('moist', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('ph', models.DecimalField(decimal_places=2, default=7, max_digits=10)),
                ('record_date', models.DateTimeField(default=datetime.datetime.now, null=True)),
                ('record_frequency_min', models.DecimalField(decimal_places=2, default=0.1, max_digits=10, validators=[django.core.validators.MaxValueValidator(10080), django.core.validators.MinValueValidator(0.1)])),
            ],
        ),
        migrations.CreateModel(
            name='SoilProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('location', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='SoilType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('good_for_min_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')])),
                ('good_for_max_moist_lvl', models.IntegerField(choices=[(0, 'Very Low'), (1, 'Low'), (2, 'Medium'), (3, 'High'), (4, 'Very High')])),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name='soilprofile',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='sensorrecord',
            name='soil_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.SoilProfile'),
        ),
        migrations.AddField(
            model_name='recommendation',
            name='soil_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.SoilProfile'),
        ),
        migrations.AddField(
            model_name='plant',
            name='lifecycle_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantLifeCycle'),
        ),
        migrations.AddField(
            model_name='plant',
            name='moist_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantMoistLvl'),
        ),
        migrations.AddField(
            model_name='plant',
            name='ph_data',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='api.PlantPh'),
        ),
    ]

# Generated by Django 2.1.7 on 2019-03-22 03:14