# Generated by Django 5.2.4 on 2025-08-04 13:18

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cultivation_calender',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('calender', models.JSONField(default=dict)),
            ],
        ),
        migrations.CreateModel(
            name='Cost',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('amount', models.BigIntegerField(default=0)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Field',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('geography', models.JSONField(default=dict)),
                ('plantdate', models.DateField(blank=True, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='images/')),
                ('comment', models.TextField(default='')),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('Irrigation', 'IRRIGATING'), ('Planting', 'PLANTING'), ('PrePlanting', 'PREPLANTING'), ('Fertilizing', 'FERTILIZING'), ('Spraying', 'SPRAYING'), ('Pruning', 'PRUNING'), ('Harvesting', 'HARVESTING')], default='Irrigating', max_length=15)),
                ('made_date', models.DateTimeField(auto_now_add=True)),
                ('due_date', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField()),
                ('costs', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='field.cost')),
                ('field', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='field.field')),
                ('images', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='field.image')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('notes', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='field.note')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('cultivation_days', models.IntegerField()),
                ('cultivation_calender', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='field.cultivation_calender')),
            ],
        ),
    ]
