# Generated by Django 5.1.dev20231216113328 on 2023-12-18 11:12

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Asiakas',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nimi', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Edustaja',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nimi', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Paamies',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nimi', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Asiakasosoite',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('osoite', models.CharField(max_length=255)),
                ('asiakas', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='testit.asiakas')),
            ],
        ),
        migrations.AddField(
            model_name='asiakas',
            name='edustaja',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='testit.edustaja'),
        ),
        migrations.CreateModel(
            name='Lasku',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numero', models.IntegerField()),
                ('asiakas', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='testit.asiakas')),
                ('paamies', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='testit.paamies')),
            ],
        ),
        migrations.CreateModel(
            name='Rivi',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('summa', models.DecimalField(decimal_places=2, max_digits=11)),
                ('lasku', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='testit.lasku')),
            ],
        ),
    ]
