<gh_stars>0
# Generated by Django 2.0.6 on 2018-06-19 11:34

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import django.utils.timezone
import model_utils.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
        ('users', '0013_auto_20180613_1443'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activite',
            fields=[
                ('start', models.DateTimeField(blank=True, null=True, verbose_name='start')),
                ('end', models.DateTimeField(blank=True, null=True, verbose_name='end')),
                ('code_activite', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('nom', models.CharField(db_index=True, max_length=50, verbose_name="Nom de l'activité")),
                ('description', models.CharField(blank=True, max_length=500, verbose_name='Description')),
                ('status', model_utils.fields.StatusField(choices=[('en cours', 'en cours'), ('achevé', 'achevé')], default='en cours', max_length=100, no_check_for_status=True)),
                ('acheve_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', when={'achevé'})),
            ],
            options={
                'verbose_name': 'Activité',
                'verbose_name_plural': 'activités',
            },
        ),
        migrations.CreateModel(
            name='ActiviteRisque',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('code_identification', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_de_risque', models.CharField(choices=[('O', 'opportunité'), ('M', 'menace')], default='M', max_length=1, verbose_name='type de risque')),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2019, 6, 19, 11, 34, 8, 221000, tzinfo=utc), verbose_name='revue prévue pour le: ')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('verifie', model_utils.fields.StatusField(choices=[(0, 'en attente'), (1, 'confirmé')], default=0, max_length=100, no_check_for_status=True, verbose_name='vérification')),
                ('verifie_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='verifie')),
                ('activite', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Activite', verbose_name='activité')),
            ],
            options={
                'verbose_name': "risque de l'activité",
                'verbose_name_plural': 'risques des activités',
                'get_latest_by': 'created',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ClasseDeRisques',
            fields=[
                ('nom', models.CharField(max_length=50, primary_key=True, serialize=False, verbose_name='Classe de risques')),
            ],
            options={
                'verbose_name': 'Classe de risques',
                'verbose_name_plural': 'Classes de risques',
            },
        ),
        migrations.CreateModel(
            name='Controle',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('start', models.DateTimeField(blank=True, null=True, verbose_name='start')),
                ('end', models.DateTimeField(blank=True, null=True, verbose_name='end')),
                ('object_id', models.CharField(max_length=36)),
                ('code_traitement', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('critere_cible', models.CharField(choices=[('O', 'Occurence'), ('S', 'Sévérité'), ('D', 'Détectabilité')], default='O', max_length=1, verbose_name='critère cible')),
                ('nom', models.CharField(max_length=300, verbose_name='nom')),
                ('status', model_utils.fields.StatusField(choices=[(0, 'en cours'), (1, 'achevé')], default=0, max_length=100, no_check_for_status=True)),
                ('acheve_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', when={'achevé'})),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(('app_label', 'risk_register'), ('model', 'activiterisque')), models.Q(('app_label', 'risk_register'), ('model', 'processusrisque')), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('cree_par', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='traitements_crees', to=settings.AUTH_USER_MODEL, verbose_name='créé par')),
                ('modifie_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='traitements_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par')),
            ],
            options={
                'verbose_name': 'Contrôle',
                'verbose_name_plural': 'Contrôles',
                'ordering': ('start',),
                'get_latest_by': 'created',
            },
        ),
        migrations.CreateModel(
            name='CritereDuRisque',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('detectabilite', models.SmallIntegerField(choices=[(6, 'Incapacité de détection'), (5, 'Capacité minime'), (4, 'Très basse'), (3, 'Moyenne'), (2, 'Détection élevée'), (1, 'Détection permanente')], verbose_name='détectabilité')),
                ('occurence', models.SmallIntegerField(choices=[(1, 'Quasi impossible'), (2, 'Très improbable'), (3, 'Improbable'), (4, 'Probable'), (5, 'Très probable'), (6, 'Quasi certain')], default=2, verbose_name='ocurrence')),
                ('severite', models.SmallIntegerField(choices=[(1, 'Faible'), (2, 'Moyenne'), (3, 'Sérieux'), (4, 'Grave'), (5, 'Très Grave'), (6, 'Catastrophique')], default=1, verbose_name='sévérité')),
                ('evalue_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='évalué par')),
            ],
            options={
                'verbose_name': 'Critérisation',
            },
        ),
        migrations.CreateModel(
            name='Estimation',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('object_id', models.CharField(max_length=36)),
                ('code_estimation', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2018, 8, 18, 11, 34, 8, 225000, tzinfo=utc), verbose_name='revue prevue pour le')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('proprietaire_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='proprietaire')),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(('app_label', 'risk_register'), ('model', 'activiterisque')), models.Q(('app_label', 'risk_register'), ('model', 'processusrisque')), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('criterisation', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='Scoring')),
                ('proprietaire', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='risques_manages', to=settings.AUTH_USER_MODEL, verbose_name='propriétaire du risque')),
            ],
            options={
                'verbose_name': 'Estimation du risque',
                'verbose_name_plural': 'Estimations des risque',
                'ordering': ('-created',),
                'get_latest_by': 'created',
            },
        ),
        migrations.CreateModel(
            name='ProcessData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=255)),
                ('commentaire', models.CharField(blank=True, help_text='Veuillez indiquer le nom du partenaire externe                                                si origine ou destination externe', max_length=255, verbose_name='commentaires')),
            ],
            options={
                'verbose_name': 'données du processus',
                'verbose_name_plural': 'données des processus',
                'ordering': ['nom'],
            },
        ),
        migrations.CreateModel(
            name='Processus',
            fields=[
                ('code_processus', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_processus', models.CharField(choices=[('PM', 'Processus de management'), ('PO', 'Processus opérationnel'), ('PS', 'Processus de soutien')], default='PO', max_length=2, verbose_name='Type de Processus')),
                ('nom', models.CharField(db_index=True, max_length=50, verbose_name='Nom')),
                ('description', models.CharField(max_length=300)),
                ('business_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.BusinessUnit', verbose_name='Propriétaire')),
                ('input_data', models.ManyToManyField(help_text="Laisser vide si destination externe à l'entreprise", related_name='clients', to='risk_register.ProcessData', verbose_name="Données d'entrée")),
                ('proc_manager', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processus_manages', to=settings.AUTH_USER_MODEL, verbose_name='manager du processus')),
            ],
            options={
                'verbose_name_plural': 'processus',
            },
        ),
        migrations.CreateModel(
            name='ProcessusRisque',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('code_identification', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_de_risque', models.CharField(choices=[('O', 'opportunité'), ('M', 'menace')], default='M', max_length=1, verbose_name='type de risque')),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2019, 6, 19, 11, 34, 8, 221000, tzinfo=utc), verbose_name='revue prévue pour le: ')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('verifie', model_utils.fields.StatusField(choices=[(0, 'en attente'), (1, 'confirmé')], default=0, max_length=100, no_check_for_status=True, verbose_name='vérification')),
                ('verifie_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='verifie')),
                ('criterisation', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='objectif scoring')),
                ('modifie_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processusrisques_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par')),
                ('processus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Processus', verbose_name='processus')),
            ],
            options={
                'verbose_name': 'risque du processus',
                'verbose_name_plural': 'risques des processus',
                'ordering': ('created', 'processus'),
                'get_latest_by': 'created',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Risque',
            fields=[
                ('code_risque', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('nom', models.CharField(max_length=200, verbose_name='nom')),
                ('description', models.TextField(db_index=True, max_length=500, verbose_name='description')),
                ('definition', models.CharField(blank=True, max_length=200, verbose_name='définition')),
                ('cause', models.TextField(max_length=500, verbose_name='cause(s)')),
                ('consequence', models.TextField(max_length=500, verbose_name='Conséquence(s)')),
                ('couverture', models.TextField(blank=True, max_length=500, verbose_name='Actions / Couverture')),
                ('pilotage', models.TextField(blank=True, max_length=500, verbose_name='Pilotage / suivi')),
                ('note', models.TextField(blank=True, max_length=255, verbose_name='Réflexion à considérer à la lecture du risque')),
                ('aide', models.TextField(blank=True, max_length=255, verbose_name='Sommes-nous concernés')),
                ('classe', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='risk_register.ClasseDeRisques')),
                ('cree_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Crée par')),
            ],
            options={
                'ordering': ('description',),
            },
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='risque',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Risque', verbose_name='risque'),
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='soumis_par',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processusrisques_soumis', to=settings.AUTH_USER_MODEL, verbose_name='soumis par'),
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='verifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='processdata',
            name='origine',
            field=models.ForeignKey(blank=True, help_text="Laisser vide si origine externe à l'entreprise", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ouput_data', to='risk_register.Processus', verbose_name='Origine'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='criterisation',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='objectif scoring'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='modifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activiterisques_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='risque',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Risque', verbose_name='risque'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='soumis_par',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activiterisques_soumis', to=settings.AUTH_USER_MODEL, verbose_name='soumis par'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='verifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='activite',
            name='processus',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activites', to='risk_register.Processus', verbose_name='Processus'),
        ),
        migrations.AddField(
            model_name='activite',
            name='responsable',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activites', to=settings.AUTH_USER_MODEL, verbose_name='employé en charge'),
        ),
        migrations.AddField(
            model_name='activite',
            name='risques',
            field=models.ManyToManyField(through='risk_register.ActiviteRisque', to='risk_register.Risque'),
        ),
        migrations.AlterUniqueTogether(
            name='risque',
            unique_together={('nom', 'description')},
        ),
        migrations.AlterUniqueTogether(
            name='processusrisque',
            unique_together={('processus', 'risque', 'type_de_risque')},
        ),
        migrations.AlterUniqueTogether(
            name='processus',
            unique_together={('business_unit', 'nom')},
        ),
        migrations.AlterUniqueTogether(
            name='processdata',
            unique_together={('nom', 'origine')},
        ),
        migrations.AlterUniqueTogether(
            name='activiterisque',
            unique_together={('activite', 'risque', 'type_de_risque')},
        ),
        migrations.AlterUniqueTogether(
            name='activite',
            unique_together={('nom', 'processus')},
        ),
    ]

# Generated by Django 2.0.6 on 2018-06-19 11:34

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import django.utils.timezone
import model_utils.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
        ('users', '0013_auto_20180613_1443'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activite',
            fields=[
                ('start', models.DateTimeField(blank=True, null=True, verbose_name='start')),
                ('end', models.DateTimeField(blank=True, null=True, verbose_name='end')),
                ('code_activite', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('nom', models.CharField(db_index=True, max_length=50, verbose_name="Nom de l'activité")),
                ('description', models.CharField(blank=True, max_length=500, verbose_name='Description')),
                ('status', model_utils.fields.StatusField(choices=[('en cours', 'en cours'), ('achevé', 'achevé')], default='en cours', max_length=100, no_check_for_status=True)),
                ('acheve_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', when={'achevé'})),
            ],
            options={
                'verbose_name': 'Activité',
                'verbose_name_plural': 'activités',
            },
        ),
        migrations.CreateModel(
            name='ActiviteRisque',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('code_identification', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_de_risque', models.CharField(choices=[('O', 'opportunité'), ('M', 'menace')], default='M', max_length=1, verbose_name='type de risque')),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2019, 6, 19, 11, 34, 8, 221000, tzinfo=utc), verbose_name='revue prévue pour le: ')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('verifie', model_utils.fields.StatusField(choices=[(0, 'en attente'), (1, 'confirmé')], default=0, max_length=100, no_check_for_status=True, verbose_name='vérification')),
                ('verifie_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='verifie')),
                ('activite', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Activite', verbose_name='activité')),
            ],
            options={
                'verbose_name': "risque de l'activité",
                'verbose_name_plural': 'risques des activités',
                'get_latest_by': 'created',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ClasseDeRisques',
            fields=[
                ('nom', models.CharField(max_length=50, primary_key=True, serialize=False, verbose_name='Classe de risques')),
            ],
            options={
                'verbose_name': 'Classe de risques',
                'verbose_name_plural': 'Classes de risques',
            },
        ),
        migrations.CreateModel(
            name='Controle',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('start', models.DateTimeField(blank=True, null=True, verbose_name='start')),
                ('end', models.DateTimeField(blank=True, null=True, verbose_name='end')),
                ('object_id', models.CharField(max_length=36)),
                ('code_traitement', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('critere_cible', models.CharField(choices=[('O', 'Occurence'), ('S', 'Sévérité'), ('D', 'Détectabilité')], default='O', max_length=1, verbose_name='critère cible')),
                ('nom', models.CharField(max_length=300, verbose_name='nom')),
                ('status', model_utils.fields.StatusField(choices=[(0, 'en cours'), (1, 'achevé')], default=0, max_length=100, no_check_for_status=True)),
                ('acheve_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', when={'achevé'})),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(('app_label', 'risk_register'), ('model', 'activiterisque')), models.Q(('app_label', 'risk_register'), ('model', 'processusrisque')), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('cree_par', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='traitements_crees', to=settings.AUTH_USER_MODEL, verbose_name='créé par')),
                ('modifie_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='traitements_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par')),
            ],
            options={
                'verbose_name': 'Contrôle',
                'verbose_name_plural': 'Contrôles',
                'ordering': ('start',),
                'get_latest_by': 'created',
            },
        ),
        migrations.CreateModel(
            name='CritereDuRisque',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('detectabilite', models.SmallIntegerField(choices=[(6, 'Incapacité de détection'), (5, 'Capacité minime'), (4, 'Très basse'), (3, 'Moyenne'), (2, 'Détection élevée'), (1, 'Détection permanente')], verbose_name='détectabilité')),
                ('occurence', models.SmallIntegerField(choices=[(1, 'Quasi impossible'), (2, 'Très improbable'), (3, 'Improbable'), (4, 'Probable'), (5, 'Très probable'), (6, 'Quasi certain')], default=2, verbose_name='ocurrence')),
                ('severite', models.SmallIntegerField(choices=[(1, 'Faible'), (2, 'Moyenne'), (3, 'Sérieux'), (4, 'Grave'), (5, 'Très Grave'), (6, 'Catastrophique')], default=1, verbose_name='sévérité')),
                ('evalue_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='évalué par')),
            ],
            options={
                'verbose_name': 'Critérisation',
            },
        ),
        migrations.CreateModel(
            name='Estimation',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('object_id', models.CharField(max_length=36)),
                ('code_estimation', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2018, 8, 18, 11, 34, 8, 225000, tzinfo=utc), verbose_name='revue prevue pour le')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('proprietaire_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='proprietaire')),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(models.Q(('app_label', 'risk_register'), ('model', 'activiterisque')), models.Q(('app_label', 'risk_register'), ('model', 'processusrisque')), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('criterisation', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='Scoring')),
                ('proprietaire', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='risques_manages', to=settings.AUTH_USER_MODEL, verbose_name='propriétaire du risque')),
            ],
            options={
                'verbose_name': 'Estimation du risque',
                'verbose_name_plural': 'Estimations des risque',
                'ordering': ('-created',),
                'get_latest_by': 'created',
            },
        ),
        migrations.CreateModel(
            name='ProcessData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=255)),
                ('commentaire', models.CharField(blank=True, help_text='Veuillez indiquer le nom du partenaire externe                                                si origine ou destination externe', max_length=255, verbose_name='commentaires')),
            ],
            options={
                'verbose_name': 'données du processus',
                'verbose_name_plural': 'données des processus',
                'ordering': ['nom'],
            },
        ),
        migrations.CreateModel(
            name='Processus',
            fields=[
                ('code_processus', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_processus', models.CharField(choices=[('PM', 'Processus de management'), ('PO', 'Processus opérationnel'), ('PS', 'Processus de soutien')], default='PO', max_length=2, verbose_name='Type de Processus')),
                ('nom', models.CharField(db_index=True, max_length=50, verbose_name='Nom')),
                ('description', models.CharField(max_length=300)),
                ('business_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.BusinessUnit', verbose_name='Propriétaire')),
                ('input_data', models.ManyToManyField(help_text="Laisser vide si destination externe à l'entreprise", related_name='clients', to='risk_register.ProcessData', verbose_name="Données d'entrée")),
                ('proc_manager', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processus_manages', to=settings.AUTH_USER_MODEL, verbose_name='manager du processus')),
            ],
            options={
                'verbose_name_plural': 'processus',
            },
        ),
        migrations.CreateModel(
            name='ProcessusRisque',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('code_identification', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_de_risque', models.CharField(choices=[('O', 'opportunité'), ('M', 'menace')], default='M', max_length=1, verbose_name='type de risque')),
                ('date_revue', models.DateTimeField(default=datetime.datetime(2019, 6, 19, 11, 34, 8, 221000, tzinfo=utc), verbose_name='revue prévue pour le: ')),
                ('criterisation_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='criterisation')),
                ('date_revue_change', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='date_revue')),
                ('verifie', model_utils.fields.StatusField(choices=[(0, 'en attente'), (1, 'confirmé')], default=0, max_length=100, no_check_for_status=True, verbose_name='vérification')),
                ('verifie_le', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='verifie')),
                ('criterisation', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='objectif scoring')),
                ('modifie_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processusrisques_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par')),
                ('processus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Processus', verbose_name='processus')),
            ],
            options={
                'verbose_name': 'risque du processus',
                'verbose_name_plural': 'risques des processus',
                'ordering': ('created', 'processus'),
                'get_latest_by': 'created',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Risque',
            fields=[
                ('code_risque', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('nom', models.CharField(max_length=200, verbose_name='nom')),
                ('description', models.TextField(db_index=True, max_length=500, verbose_name='description')),
                ('definition', models.CharField(blank=True, max_length=200, verbose_name='définition')),
                ('cause', models.TextField(max_length=500, verbose_name='cause(s)')),
                ('consequence', models.TextField(max_length=500, verbose_name='Conséquence(s)')),
                ('couverture', models.TextField(blank=True, max_length=500, verbose_name='Actions / Couverture')),
                ('pilotage', models.TextField(blank=True, max_length=500, verbose_name='Pilotage / suivi')),
                ('note', models.TextField(blank=True, max_length=255, verbose_name='Réflexion à considérer à la lecture du risque')),
                ('aide', models.TextField(blank=True, max_length=255, verbose_name='Sommes-nous concernés')),
                ('classe', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='risk_register.ClasseDeRisques')),
                ('cree_par', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Crée par')),
            ],
            options={
                'ordering': ('description',),
            },
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='risque',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Risque', verbose_name='risque'),
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='soumis_par',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='processusrisques_soumis', to=settings.AUTH_USER_MODEL, verbose_name='soumis par'),
        ),
        migrations.AddField(
            model_name='processusrisque',
            name='verifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='processdata',
            name='origine',
            field=models.ForeignKey(blank=True, help_text="Laisser vide si origine externe à l'entreprise", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ouput_data', to='risk_register.Processus', verbose_name='Origine'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='criterisation',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='risk_register.CritereDuRisque', verbose_name='objectif scoring'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='modifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activiterisques_modifies', to=settings.AUTH_USER_MODEL, verbose_name='modifié par'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='risque',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='risk_register.Risque', verbose_name='risque'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='soumis_par',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activiterisques_soumis', to=settings.AUTH_USER_MODEL, verbose_name='soumis par'),
        ),
        migrations.AddField(
            model_name='activiterisque',
            name='verifie_par',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='activite',
            name='processus',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activites', to='risk_register.Processus', verbose_name='Processus'),
        ),
        migrations.AddField(
            model_name='activite',
            name='responsable',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activites', to=settings.AUTH_USER_MODEL, verbose_name='employé en charge'),
        ),
        migrations.AddField(
            model_name='activite',
            name='risques',
            field=models.ManyToManyField(through='risk_register.ActiviteRisque', to='risk_register.Risque'),
        ),
        migrations.AlterUniqueTogether(
            name='risque',
            unique_together={('nom', 'description')},
        ),
        migrations.AlterUniqueTogether(
            name='processusrisque',
            unique_together={('processus', 'risque', 'type_de_risque')},
        ),
        migrations.AlterUniqueTogether(
            name='processus',
            unique_together={('business_unit', 'nom')},
        ),
        migrations.AlterUniqueTogether(
            name='processdata',
            unique_together={('nom', 'origine')},
        ),
        migrations.AlterUniqueTogether(
            name='activiterisque',
            unique_together={('activite', 'risque', 'type_de_risque')},
        ),
        migrations.AlterUniqueTogether(
            name='activite',
            unique_together={('nom', 'processus')},
        ),
    ]
# Generated by Django 2.0.6 on 2018-06-19 11:34