# Generated by Django 3.1.5 on 2021-01-25 06:19

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Consumer',
            fields=[
                ('id', models.CharField(max_length=30, primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email_id', models.EmailField(max_length=254)),
                ('password', models.CharField(max_length=200)),
                ('dob', models.DateField(null=True)),
                ('address', models.TextField(max_length=250, null=True)),
                ('gender', models.CharField(choices=[('M', 'MALE'), ('F', 'FEMALE'), ('N', 'NOTAPPLICABEL')], max_length=10, null=True)),
            ],
            options={
                'db_table': 'CONSUMER',
            },
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.CharField(max_length=30, primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('email_id', models.EmailField(max_length=254)),
                ('password', models.CharField(max_length=200)),
                ('dob', models.DateField(null=True)),
                ('salary', models.IntegerField(null=True)),
                ('address', models.TextField(max_length=250, null=True)),
                ('gender', models.CharField(choices=[('M', 'MALE'), ('F', 'FEMALE'), ('N', 'NOTAPPLICABEL')], max_length=10, null=True)),
            ],
            options={
                'db_table': 'EMPLOYEE',
            },
        ),
        migrations.CreateModel(
            name='Town',
            fields=[
                ('town_id', models.AutoField(primary_key=True, serialize=False)),
                ('location', models.CharField(max_length=30)),
            ],
            options={
                'db_table': 'TOWN',
            },
        ),
        migrations.CreateModel(
            name='Ward',
            fields=[
                ('ward_id', models.AutoField(primary_key=True, serialize=False)),
                ('member_name', models.CharField(max_length=40)),
                ('town', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.town')),
            ],
            options={
                'db_table': 'WARD',
            },
        ),
        migrations.CreateModel(
            name='WaterBill',
            fields=[
                ('bill_id', models.AutoField(primary_key=True, serialize=False)),
                ('amount', models.IntegerField(default=0)),
                ('is_paid', models.BooleanField(default=False)),
                ('read_value', models.IntegerField()),
                ('read_date', models.DateField()),
                ('due_date', models.DateField()),
                ('disconnection_date', models.DateField()),
                ('collector', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.employee')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.consumer')),
                ('ward', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.ward')),
            ],
            options={
                'db_table': 'WATERBILL',
            },
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('payment_id', models.AutoField(primary_key=True, serialize=False)),
                ('payment_date', models.DateTimeField(default=datetime.datetime.now)),
                ('payment_type', models.CharField(choices=[('ON', 'ONLINE'), ('OFF', 'OFFLINE')], default='Online', max_length=10, null=True)),
                ('bill', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.waterbill')),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.consumer')),
            ],
            options={
                'db_table': 'PAYMENT',
            },
        ),
        migrations.CreateModel(
            name='Meter',
            fields=[
                ('meter_id', models.AutoField(primary_key=True, serialize=False)),
                ('meter_health', models.CharField(choices=[('G', 'GOOD'), ('O', 'OK'), ('B', 'BAD')], max_length=10, null=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.employee')),
                ('ward', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.ward')),
            ],
            options={
                'db_table': 'METER',
            },
        ),
        migrations.CreateModel(
            name='Complaint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('complaint_data', models.TextField(max_length=150)),
                ('is_resolved', models.BooleanField(default=False, null=True)),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Employee.consumer')),
            ],
            options={
                'db_table': 'COMPLAINTS',
            },
        ),
    ]
