# Generated by Django 2.1.4 on 2018-12-06 09:28

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensions.db.fields
import model_utils.fields
import partial_index
import pyfb_rating.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('pyfb_direction', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='CallerNumList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
                ('callerid_filter', models.CharField(choices=[('1', 'No filter'), ('2', 'Prefix authorized'), ('3', 'Prefix prohibited')], default='1', max_length=2, verbose_name='CallerID Prefix filter')),
                ('destination', models.ManyToManyField(to='pyfb_direction.Destination')),
            ],
            options={
                'ordering': ('-name',),
                'db_table': 'pyfb_rating_callernum_list',
            },
        ),
        migrations.CreateModel(
            name='CustomerCountryRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_country_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerCountryTypeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_countrytype_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerDefaultRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_default_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerDestinationRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_destination_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerPrefixRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('prefix', models.CharField(db_index=True, max_length=30, verbose_name='numeric prefix')),
                ('destnum_length', models.PositiveSmallIntegerField(default=0, help_text='If value > 0, then destination number must match tsi length', verbose_name='Destination number length')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_prefix_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerRatecard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('status', model_utils.fields.StatusField(choices=[('enabled', 'Enabled'), ('disabled', 'Disabled')], default='enabled', max_length=100, no_check_for_status=True, verbose_name='status')),
                ('status_changed', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', verbose_name='status changed')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('date_start', models.DateTimeField(default=django.utils.timezone.now)),
                ('date_end', models.DateTimeField(default=pyfb_rating.models.default_time)),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='name')),
                ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
                ('rc_type', models.CharField(choices=[('pstn', 'Outbound calls'), ('did', 'DID - Inbound calls'), ('pstn2did', 'Outbound calls to internal DID'), ('emergency', 'Emergency calls')], default='pstn', help_text='Select the right ratecard regarding the type of calls. Default is PSTN', max_length=10, verbose_name='Type of ratecards')),
                ('callerid_list', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='pyfb_rating.CallerNumList')),
            ],
            options={
                'ordering': ('name',),
                'db_table': 'pyfb_rating_c_ratecard',
            },
        ),
        migrations.CreateModel(
            name='CustomerRegionRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('c_ratecard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Region')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_region_rate',
            },
        ),
        migrations.CreateModel(
            name='CustomerRegionTypeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('c_ratecard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Region')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Type')),
            ],
            options={
                'ordering': ('c_ratecard',),
                'db_table': 'pyfb_rating_c_regiontype_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderCountryRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Country')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_country_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderCountryTypeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Country')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_countrytype_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderDefaultRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_default_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderDestinationRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('destination', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Destination')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_destination_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderPrefixRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('prefix', models.CharField(db_index=True, max_length=30, verbose_name='numeric prefix')),
                ('destnum_length', models.PositiveSmallIntegerField(default=0, help_text='If value > 0, then destination number must match tsi length', verbose_name='Destination number length')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_prefix_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderRatecard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('status', model_utils.fields.StatusField(choices=[('enabled', 'Enabled'), ('disabled', 'Disabled')], default='enabled', max_length=100, no_check_for_status=True, verbose_name='status')),
                ('status_changed', model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', verbose_name='status changed')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('date_start', models.DateTimeField(default=django.utils.timezone.now)),
                ('date_end', models.DateTimeField(default=pyfb_rating.models.default_time)),
                ('name', models.CharField(max_length=128, unique=True)),
                ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
                ('rc_type', models.CharField(choices=[('pstn', 'Outbound calls'), ('did', 'DID - Inbound calls'), ('pstn2did', 'Outbound calls to internal DID'), ('emergency', 'Emergency calls')], default='pstn', help_text='Select the right ratecard regarding the type of calls. Default is PSTN', max_length=10, verbose_name='Type of ratecards')),
                ('provider_prefix', models.CharField(blank=True, default='', max_length=10, verbose_name='prefix')),
                ('estimated_quality', models.PositiveSmallIntegerField(default='10', help_text='Estimated quality. Number between 0 to 10', validators=[django.core.validators.MaxValueValidator(10)], verbose_name='quality')),
                ('callerid_list', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='pyfb_rating.CallerNumList')),
            ],
            options={
                'ordering': ('name',),
                'db_table': 'pyfb_rating_p_ratecard',
            },
        ),
        migrations.CreateModel(
            name='ProviderRegionRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('p_ratecard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Region')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_region_rate',
            },
        ),
        migrations.CreateModel(
            name='ProviderRegionTypeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('r_rate', models.DecimalField(decimal_places=5, help_text='rate per minute', max_digits=11, verbose_name='sell rate')),
                ('r_block_min_duration', models.PositiveSmallIntegerField(default=1, verbose_name='Increment')),
                ('r_minimal_time', models.PositiveSmallIntegerField(default=0, help_text='minimal time to be billed in seconds', verbose_name='Minimal time')),
                ('r_init_block', models.DecimalField(decimal_places=5, default=0, max_digits=11, verbose_name='Connection fee')),
                ('status', models.CharField(choices=[('enabled', 'Enabled'), ('enabled_negmargin', 'Enabled allowing negative margin'), ('disabled', 'Disabled'), ('blocked', 'Blocked')], default='enabled', help_text='State of the rate : enabled / blocked - calls to this destination are blocked / disabled', max_length=20, verbose_name='Status')),
                ('p_ratecard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard')),
                ('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Region')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Type')),
            ],
            options={
                'ordering': ('p_ratecard',),
                'db_table': 'pyfb_rating_p_regiontype_rate',
            },
        ),
        migrations.AddField(
            model_name='providerprefixrate',
            name='p_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard'),
        ),
        migrations.AddField(
            model_name='providerdestinationrate',
            name='p_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard'),
        ),
        migrations.AddField(
            model_name='providerdefaultrate',
            name='p_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard'),
        ),
        migrations.AddField(
            model_name='providercountrytyperate',
            name='p_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard'),
        ),
        migrations.AddField(
            model_name='providercountrytyperate',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Type'),
        ),
        migrations.AddField(
            model_name='providercountryrate',
            name='p_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.ProviderRatecard'),
        ),
        migrations.AddField(
            model_name='customerprefixrate',
            name='c_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard'),
        ),
        migrations.AddField(
            model_name='customerdestinationrate',
            name='c_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard'),
        ),
        migrations.AddField(
            model_name='customerdestinationrate',
            name='destination',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Destination'),
        ),
        migrations.AddField(
            model_name='customerdefaultrate',
            name='c_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard'),
        ),
        migrations.AddField(
            model_name='customercountrytyperate',
            name='c_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard'),
        ),
        migrations.AddField(
            model_name='customercountrytyperate',
            name='country',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Country'),
        ),
        migrations.AddField(
            model_name='customercountrytyperate',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Type'),
        ),
        migrations.AddField(
            model_name='customercountryrate',
            name='c_ratecard',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_rating.CustomerRatecard'),
        ),
        migrations.AddField(
            model_name='customercountryrate',
            name='country',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pyfb_direction.Country'),
        ),
        migrations.AddIndex(
            model_name='providerregiontyperate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'region', 'type'], name='pyfb_rating_p_ratec_c60454_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providerregiontyperate',
            unique_together={('p_ratecard', 'region', 'type')},
        ),
        migrations.AddIndex(
            model_name='providerregionrate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'region'], name='pyfb_rating_p_ratec_6ac129_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providerregionrate',
            unique_together={('p_ratecard', 'region')},
        ),
        migrations.AddIndex(
            model_name='providerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_5d117c_partial', unique=False, where_postgresql="status = 'enabled'", where_sqlite=''),
        ),
        migrations.AddIndex(
            model_name='providerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_47a748_partial', unique=False, where="status = 'enabled' AND rc_type = 'PSTN'"),
        ),
        migrations.AddIndex(
            model_name='providerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_0bf84b_partial', unique=False, where="status = 'enabled' AND rc_type = 'DIDIN'"),
        ),
        migrations.AddIndex(
            model_name='providerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_a37e0b_partial', unique=False, where="status = 'enabled' AND rc_type = 'DIDOUT'"),
        ),
        migrations.AddIndex(
            model_name='providerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_a78fa9_partial', unique=False, where="status = 'enabled' AND rc_type = 'EMERGENCY'"),
        ),
        migrations.AddIndex(
            model_name='providerprefixrate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'prefix', 'destnum_length'], name='pyfb_rating_p_ratec_ec17e8_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providerprefixrate',
            unique_together={('p_ratecard', 'prefix', 'destnum_length')},
        ),
        migrations.AddIndex(
            model_name='providerdestinationrate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'destination'], name='pyfb_rating_p_ratec_f9b94c_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providerdestinationrate',
            unique_together={('p_ratecard', 'destination')},
        ),
        migrations.AddIndex(
            model_name='providerdefaultrate',
            index=models.Index(fields=['p_ratecard'], name='pyfb_rating_p_ratec_e85f44_idx'),
        ),
        migrations.AddIndex(
            model_name='providerdefaultrate',
            index=partial_index.PartialIndex(fields=['p_ratecard'], name='pyfb_rating_p_ratec_0a62fc_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AddIndex(
            model_name='providercountrytyperate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'country', 'type'], name='pyfb_rating_p_ratec_1beb3b_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providercountrytyperate',
            unique_together={('p_ratecard', 'country', 'type')},
        ),
        migrations.AddIndex(
            model_name='providercountryrate',
            index=partial_index.PartialIndex(fields=['p_ratecard', 'country'], name='pyfb_rating_p_ratec_c2de1d_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='providercountryrate',
            unique_together={('p_ratecard', 'country')},
        ),
        migrations.AddIndex(
            model_name='customerregiontyperate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'region', 'type'], name='pyfb_rating_c_ratec_3b71f9_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customerregiontyperate',
            unique_together={('c_ratecard', 'region', 'type')},
        ),
        migrations.AddIndex(
            model_name='customerregionrate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'region'], name='pyfb_rating_c_ratec_7ea5bf_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customerregionrate',
            unique_together={('c_ratecard', 'region')},
        ),
        migrations.AddIndex(
            model_name='customerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_2b3593_partial', unique=False, where_postgresql="status = 'enabled'", where_sqlite=''),
        ),
        migrations.AddIndex(
            model_name='customerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_7ee8d2_partial', unique=False, where="status = 'enabled' AND rc_type = 'PSTN'"),
        ),
        migrations.AddIndex(
            model_name='customerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_83b1f8_partial', unique=False, where="status = 'enabled' AND rc_type = 'DIDIN'"),
        ),
        migrations.AddIndex(
            model_name='customerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_f993d1_partial', unique=False, where="status = 'enabled' AND rc_type = 'DIDOUT'"),
        ),
        migrations.AddIndex(
            model_name='customerratecard',
            index=partial_index.PartialIndex(fields=['id', 'rc_type'], name='pyfb_rating_id_8d344b_partial', unique=False, where="status = 'enabled' AND rc_type = 'EMERGENCY'"),
        ),
        migrations.AddIndex(
            model_name='customerprefixrate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'prefix', 'destnum_length'], name='pyfb_rating_c_ratec_b98511_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customerprefixrate',
            unique_together={('c_ratecard', 'prefix', 'destnum_length')},
        ),
        migrations.AddIndex(
            model_name='customerdestinationrate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'destination'], name='pyfb_rating_c_ratec_b94a47_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customerdestinationrate',
            unique_together={('c_ratecard', 'destination')},
        ),
        migrations.AddIndex(
            model_name='customerdefaultrate',
            index=models.Index(fields=['c_ratecard'], name='pyfb_rating_c_ratec_cda8b7_idx'),
        ),
        migrations.AddIndex(
            model_name='customerdefaultrate',
            index=partial_index.PartialIndex(fields=['c_ratecard'], name='pyfb_rating_c_ratec_e9a380_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AddIndex(
            model_name='customercountrytyperate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'country', 'type'], name='pyfb_rating_c_ratec_d59036_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customercountrytyperate',
            unique_together={('c_ratecard', 'country', 'type')},
        ),
        migrations.AddIndex(
            model_name='customercountryrate',
            index=partial_index.PartialIndex(fields=['c_ratecard', 'country'], name='pyfb_rating_c_ratec_7fddda_partial', unique=True, where="status <> 'disabled'"),
        ),
        migrations.AlterUniqueTogether(
            name='customercountryrate',
            unique_together={('c_ratecard', 'country')},
        ),
    ]
