# Generated by Django 2.1.5 on 2019-11-05 15:52

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Companies',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('nip', models.IntegerField(max_length=11)),
                ('adres', models.CharField(max_length=100)),
                ('city', models.CharField(max_length=50)),
                ('id_deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('surname', models.CharField(max_length=50)),
                ('phone', models.IntegerField(max_length=11)),
                ('mail', models.CharField(max_length=20)),
                ('job', models.CharField(max_length=50)),
                ('id_deleted', models.BooleanField(default=False)),
                ('id_company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Companies')),
            ],
        ),
        migrations.CreateModel(
            name='Notes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=500)),
                ('id_deleted', models.BooleanField(default=False)),
                ('id_company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Companies')),
            ],
        ),
        migrations.CreateModel(
            name='Rules',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Trades',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('surname', models.CharField(max_length=50)),
                ('date_of_birth', models.DateField()),
                ('login', models.CharField(max_length=50)),
                ('password', models.CharField(max_length=50)),
                ('id_deleted', models.BooleanField(default=False)),
                ('id_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Rules')),
            ],
        ),
        migrations.AddField(
            model_name='notes',
            name='id_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Users'),
        ),
        migrations.AddField(
            model_name='contact',
            name='id_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Users'),
        ),
        migrations.AddField(
            model_name='companies',
            name='id_trade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Trades'),
        ),
        migrations.AddField(
            model_name='companies',
            name='id_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='CRM.Users'),
        ),
    ]
