# Generated by Django 5.0 on 2026-02-15 02:45

import django.contrib.gis.db.models.fields
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='OfficialChusankanField',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('c_id', models.CharField(max_length=20, unique=True, verbose_name='中山間ID')),
                ('oaza', models.CharField(max_length=100, verbose_name='大字')),
                ('aza', models.CharField(max_length=100, verbose_name='字')),
                ('chiban', models.CharField(max_length=50, verbose_name='地番')),
                ('area', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='面積(ha)')),
                ('payment_amount', models.DecimalField(blank=True, decimal_places=0, max_digits=12, null=True, verbose_name='支払金額')),
            ],
            options={
                'verbose_name': '中山間マスタ',
                'verbose_name_plural': '中山間マスタ',
            },
        ),
        migrations.CreateModel(
            name='OfficialKyosaiField',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('k_num', models.CharField(max_length=20, unique=True, verbose_name='共済番号')),
                ('s_num', models.CharField(blank=True, max_length=20, null=True, verbose_name='枝番')),
                ('address', models.CharField(max_length=255, verbose_name='住所')),
                ('kanji_name', models.CharField(max_length=100, verbose_name='漢字名')),
                ('area', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='面積(ha)')),
            ],
            options={
                'verbose_name': '共済マスタ',
                'verbose_name_plural': '共済マスタ',
            },
        ),
        migrations.CreateModel(
            name='Field',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='圃場名')),
                ('address', models.CharField(max_length=255, verbose_name='住所')),
                ('area_tan', models.DecimalField(decimal_places=4, max_digits=6, verbose_name='面積(反)')),
                ('area_m2', models.IntegerField(verbose_name='面積(m2)')),
                ('owner_name', models.CharField(max_length=100, verbose_name='所有者名')),
                ('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326, verbose_name='位置情報')),
                ('chusankan_field', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fields', to='fields.officialchusankanfield', verbose_name='関連中山間マスタ')),
                ('kyosai_field', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fields', to='fields.officialkyosaifield', verbose_name='関連共済マスタ')),
            ],
            options={
                'verbose_name': '圃場',
                'verbose_name_plural': '圃場',
            },
        ),
    ]
