# Generated by Django 5.1.5 on 2025-02-01 17:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('address', '0003_alter_address_table'),
        ('room', '0002_alter_room_table'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tenant',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('phone_number', models.CharField(max_length=10, unique=True)),
                ('adhar_number', models.CharField(max_length=12, unique=True)),
                ('guardian_name', models.CharField(max_length=255)),
                ('guardian_phone_number', models.CharField(max_length=10)),
                ('guardian_relation', models.CharField(max_length=50)),
                ('occupation', models.CharField(choices=[('job', 'Job'), ('student', 'Student'), ('other', 'Other')], default='student', max_length=20)),
                ('occupation_address', models.CharField(max_length=255)),
                ('occupation_contact', models.CharField(max_length=10)),
                ('id_proof', models.FileField(blank=True, null=True, upload_to='tenant_id_proofs/')),
                ('check_in', models.DateField()),
                ('check_out', models.DateField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('address', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tenant_address', to='address.address')),
                ('room', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tenants', to='room.room')),
            ],
            options={
                'db_table': 'tenants',
                'ordering': ['name'],
            },
        ),
    ]
