# Generated by Django 3.2.17 on 2023-03-16 19:52

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


class Migration(migrations.Migration):

    dependencies = [
        ('orgs', '0024_salesforce_configurations'),
        ('seed', '0185_auto_20230112_0922'),
    ]

    operations = [
        migrations.CreateModel(
            name='SalesforceMapping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('salesforce_fieldname', models.CharField(max_length=255)),
                ('column', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='salesforce_column', to='seed.column')),
                ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='salesforce_mappings', to='orgs.organization', verbose_name='SeedOrg')),
            ],
        ),
        migrations.CreateModel(
            name='SalesforceConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('account_rec_type', models.CharField(blank=True, max_length=20, null=True)),
                ('contact_rec_type', models.CharField(blank=True, max_length=20, null=True)),
                ('last_update_date', models.DateTimeField(blank=True, null=True)),
                ('unique_benchmark_id_fieldname', models.CharField(blank=True, max_length=128, null=True)),
                ('url', models.CharField(blank=True, max_length=200, null=True)),
                ('username', models.CharField(blank=True, max_length=128, null=True)),
                ('password', models.CharField(blank=True, max_length=128, null=True)),
                ('security_token', models.CharField(blank=True, max_length=128, null=True)),
                ('domain', models.CharField(blank=True, max_length=50, null=True)),
                ('cycle_fieldname', models.CharField(blank=True, max_length=128, null=True)),
                ('status_fieldname', models.CharField(blank=True, max_length=128, null=True)),
                ('labels_fieldname', models.CharField(blank=True, max_length=128, null=True)),
                ('benchmark_contact_fieldname', models.CharField(blank=True, max_length=128, null=True)),
                ('logging_email', models.CharField(blank=True, max_length=128, null=True)),
                ('update_at_hour', models.IntegerField(blank=True, null=True)),
                ('update_at_minute', models.IntegerField(blank=True, null=True)),
                ('account_name_column', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='account_name_column', to='seed.column')),
                ('compliance_label', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='compliance_label', to='seed.statuslabel')),
                ('contact_email_column', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contact_email_column', to='seed.column')),
                ('contact_name_column', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contact_name_column', to='seed.column')),
                ('indication_label', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='indication_label', to='seed.statuslabel')),
                ('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='orgs.organization')),
                ('seed_benchmark_id_column', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='benchmark_id_column', to='seed.column')),
                ('violation_label', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='violation_label', to='seed.statuslabel')),
            ],
        ),
        migrations.AddConstraint(
            model_name='salesforcemapping',
            constraint=models.UniqueConstraint(fields=('column', 'salesforce_fieldname'), name='unique_column_salesforce_field'),
        ),
        migrations.AddConstraint(
            model_name='salesforceconfig',
            constraint=models.CheckConstraint(check=models.Q(('update_at_hour__range', (0, 23))), name='salesforce_update_at_hour_range'),
        ),
        migrations.AddConstraint(
            model_name='salesforceconfig',
            constraint=models.CheckConstraint(check=models.Q(('update_at_minute__range', (0, 59))), name='salesforce_update_at_minute_range'),
        ),
    ]
