# Generated by Django 2.0.5 on 2018-09-04 07:59

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Diagram',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='Illustration', max_length=50)),
                ('height', models.IntegerField()),
                ('width', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='GraphArrow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('X0', models.FloatField(blank=True, null=True)),
                ('Y0', models.FloatField(blank=True, null=True)),
                ('X1', models.FloatField(blank=True, null=True)),
                ('Y1', models.FloatField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='GraphNode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('radius', models.FloatField()),
                ('X', models.FloatField()),
                ('Y', models.FloatField()),
                ('diagram', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nodes', to='graphs.Diagram')),
            ],
        ),
        migrations.CreateModel(
            name='Icon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100)),
                ('source', models.CharField(blank=True, max_length=200)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='graphs/icons/')),
                ('color', models.CharField(default='grey', max_length=50)),
                ('order', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Link',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relative_share', models.FloatField(blank=True, default=None, null=True)),
                ('cause_description', models.CharField(blank=True, max_length=400)),
                ('consequence_description', models.CharField(blank=True, max_length=400)),
            ],
        ),
        migrations.CreateModel(
            name='Sector',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('short_description', models.CharField(blank=True, max_length=400)),
                ('color', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('short_description', models.CharField(blank=True, max_length=400)),
                ('date_created', models.DateField(auto_now_add=True)),
                ('icon_picture', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='graphs.Icon')),
                ('sector', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='graphs.Sector')),
            ],
        ),
        migrations.AddField(
            model_name='link',
            name='cause',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='consequences', to='graphs.Topic'),
        ),
        migrations.AddField(
            model_name='link',
            name='consequence',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='causes', to='graphs.Topic'),
        ),
        migrations.AddField(
            model_name='graphnode',
            name='liens',
            field=models.ManyToManyField(blank=True, to='graphs.Link'),
        ),
        migrations.AddField(
            model_name='graphnode',
            name='sector',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='graphs.Sector'),
        ),
        migrations.AddField(
            model_name='graphnode',
            name='topic',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='graphs.Topic'),
        ),
        migrations.AddField(
            model_name='grapharrow',
            name='cause',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='graphs.GraphNode'),
        ),
        migrations.AddField(
            model_name='grapharrow',
            name='consequence',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='graphs.GraphNode'),
        ),
        migrations.AddField(
            model_name='grapharrow',
            name='diagram',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrows', to='graphs.Diagram'),
        ),
    ]
