# Generated by Django 2.2.3 on 2019-08-19 10:41

import datetime
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AdgroupPerformanceReportModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CpcBid', models.CharField(blank=True, max_length=255, null=True)),
                ('CampaignName', models.CharField(blank=True, max_length=255, null=True)),
                ('AdGroupName', models.CharField(blank=True, max_length=255, null=True)),
                ('Labels', models.CharField(blank=True, max_length=255, null=True)),
                ('EffectiveTargetRoas', models.CharField(blank=True, max_length=50, null=True)),
                ('TargetCpa', models.CharField(blank=True, max_length=50, null=True)),
                ('ExternalCustomerId', models.CharField(blank=True, max_length=255, null=True)),
                ('CampaignId', models.CharField(blank=True, max_length=255, null=True)),
                ('AdGroupId', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('Clicks', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Impressions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Ctr', models.CharField(blank=True, max_length=50, null=True)),
                ('AverageCpc', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AveragePosition', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('TopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AbsoluteTopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Conversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversionRate', models.CharField(blank=True, max_length=50, null=True)),
                ('ConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ViewThroughConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ConversionRate', models.CharField(blank=True, max_length=50, null=True)),
                ('ValuePerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ValuePerAllConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerAllConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ROAS', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_click', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ClickAssistedConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ImpressionAssistedConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchExactMatchImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchRankLostImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('ContentImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchAbsoluteTopImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchRankLostTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchRankLostAbsoluteTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
            ],
            options={
                'db_table': 'adgroup_performance_report',
            },
        ),
        migrations.CreateModel(
            name='AdwordsCampaign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('campaign_id', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('name', models.CharField(max_length=255)),
                ('status', models.CharField(choices=[('U', 'UNKNOWN'), ('E', 'ENABLED'), ('P', 'PAUSED'), ('R', 'REMOVED')], default='U', max_length=10)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('budget', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('conversion_optimizer_eligibility', models.BooleanField(blank=True, null=True)),
                ('settings', jsonfield.fields.JSONField(blank=True, default='{"xsi_type": "TargetingSetting","details": [{"xsi_type": "TargetingSettingDetail","criterionTypeGroup": "PLACEMENT","targetAll": "false"},{"xsi_type": "TargetingSettingDetail","criterionTypeGroup": "VERTICAL","targetAll": "true"}]}')),
                ('bidding_strategy_configuration', jsonfield.fields.JSONField(blank=True, default='{"bids": [{"xsi_type" : "CpcBid","bid": {"microAmount": "1000000"}}]}')),
                ('advertising_channel_type', models.CharField(choices=[('DISPLAY', 'DISPLAY'), ('SEARCH', 'SEARCH')], default='SEARCH', max_length=15)),
                ('label', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'db_table': 'adwords_campaign',
            },
        ),
        migrations.CreateModel(
            name='AdwordsCampaignGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group_id', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('name', models.CharField(max_length=255)),
                ('status', models.CharField(choices=[('U', 'UNKNOWN'), ('E', 'ENABLED'), ('P', 'PAUSED'), ('R', 'REMOVED')], default='U', max_length=10)),
                ('campaign', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.AdwordsCampaign')),
            ],
            options={
                'db_table': 'adwords_campaign_groups',
            },
        ),
        migrations.CreateModel(
            name='CampaignPerformanceReportModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CampaignId', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('CampaignName', models.CharField(blank=True, max_length=255, null=True)),
                ('Labels', models.CharField(blank=True, max_length=255, null=True)),
                ('BiddingStrategyType', models.CharField(blank=True, max_length=255, null=True)),
                ('ExternalCustomerId', models.CharField(blank=True, max_length=255, null=True)),
                ('AdvertisingChannelType', models.CharField(blank=True, max_length=255, null=True)),
                ('Clicks', models.IntegerField(default=0)),
                ('Impressions', models.IntegerField(default=0)),
                ('Cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Ctr', models.CharField(blank=True, max_length=50, null=True)),
                ('AverageCpc', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AveragePosition', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('TopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AbsoluteTopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Conversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversionRate', models.CharField(blank=True, max_length=50, null=True)),
                ('AllConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ViewThroughConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ConversionRate', models.CharField(blank=True, max_length=50, null=True)),
                ('ValuePerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ValuePerAllConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerAllConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ROAS', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_click', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ClickAssistedConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ImpressionAssistedConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchExactMatchImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchRankLostImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchBudgetLostImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('ContentRankLostImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('ContentImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchAbsoluteTopImpressionShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchClickShare', models.CharField(blank=True, max_length=50, null=True)),
                ('SearchTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchRankLostTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('SearchRankLostAbsoluteTopImpressionShare', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
            ],
            options={
                'db_table': 'campaign_performance_report',
            },
        ),
        migrations.CreateModel(
            name='KeywordPerformanceReportModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('CpcBid', models.CharField(blank=True, max_length=255, null=True)),
                ('CampaignName', models.CharField(blank=True, max_length=255, null=True)),
                ('AdGroupName', models.CharField(blank=True, max_length=255, null=True)),
                ('KeywordMatchType', models.CharField(blank=True, max_length=255, null=True)),
                ('FirstPageCpc', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('TopOfPageCpc', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('FirstPositionCpc', models.CharField(blank=True, max_length=255, null=True)),
                ('Criteria', models.CharField(blank=True, max_length=255, null=True)),
                ('Labels', models.CharField(blank=True, max_length=255, null=True)),
                ('ExternalCustomerId', models.CharField(blank=True, max_length=255, null=True)),
                ('CampaignId', models.CharField(blank=True, max_length=255, null=True)),
                ('AdGroupId', models.CharField(blank=True, max_length=255, null=True)),
                ('Id', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('QualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('HistoricalQualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchPredictedCtr', models.CharField(blank=True, max_length=255, null=True)),
                ('HistoricalSearchPredictedCtr', models.CharField(blank=True, max_length=255, null=True)),
                ('PostClickQualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('HistoricalLandingPageQualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('CreativeQualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('HistoricalCreativeQualityScore', models.CharField(blank=True, max_length=255, null=True)),
                ('Clicks', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Impressions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Ctr', models.CharField(blank=True, max_length=255, null=True)),
                ('AverageCpc', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AveragePosition', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('TopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AbsoluteTopImpressionPercentage', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('Conversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('AllConversionRate', models.CharField(blank=True, max_length=255, null=True)),
                ('ConversionValue', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ViewThroughConversions', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ConversionRate', models.CharField(blank=True, max_length=255, null=True)),
                ('ValuePerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerAllConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('CostPerConversion', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ROAS', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('all_conversion_value_per_click', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('conversion_value_per_cost', models.DecimalField(decimal_places=2, default=0.0, max_digits=30)),
                ('ClickAssistedConversions', models.CharField(blank=True, max_length=255, null=True)),
                ('ImpressionAssistedConversions', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchExactMatchImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchRankLostImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchAbsoluteTopImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchTopImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchRankLostTopImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
                ('SearchRankLostAbsoluteTopImpressionShare', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'db_table': 'keyword_performance_report',
            },
        ),
        migrations.CreateModel(
            name='Rule_Engine_Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recipe_name', models.CharField(blank=True, default='New Recipe', max_length=255, null=True)),
                ('date_created', models.DateField(auto_now=True)),
                ('scope', models.CharField(blank=True, max_length=255, null=True)),
                ('created_by', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'db_table': 'recipe',
            },
        ),
        migrations.CreateModel(
            name='Rule_Engine_Rules',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rule_name', models.CharField(blank=True, default='New rule', max_length=255, null=True)),
                ('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.Rule_Engine_Recipe')),
            ],
            options={
                'db_table': 'rules',
            },
        ),
        migrations.CreateModel(
            name='Rule_Engine_Conditions',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField(auto_now=True)),
                ('end_date', models.DateField(blank=True, default=datetime.datetime.now)),
                ('attribute_operand', models.CharField(blank=True, max_length=255, null=True)),
                ('operation', models.CharField(blank=True, max_length=255, null=True)),
                ('value_operand', models.CharField(blank=True, max_length=255, null=True)),
                ('scope', models.CharField(blank=True, max_length=255, null=True)),
                ('operation_type', models.CharField(blank=True, max_length=255, null=True)),
                ('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.Rule_Engine_Recipe')),
                ('rule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='myproject.Rule_Engine_Rules')),
            ],
            options={
                'db_table': 'conditions',
            },
        ),
        migrations.CreateModel(
            name='Rule_Engine_Action',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attribute_operand', models.CharField(blank=True, max_length=255, null=True)),
                ('operation', models.CharField(blank=True, max_length=255, null=True)),
                ('attribute_value', models.CharField(blank=True, max_length=255, null=True)),
                ('action_scope', models.CharField(blank=True, max_length=255, null=True)),
                ('rule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='myproject.Rule_Engine_Rules')),
            ],
            options={
                'db_table': 'actions',
            },
        ),
        migrations.CreateModel(
            name='AdwordsCampaignRuleEngine_keywords',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('keyword_id', models.CharField(max_length=255, null=True, unique=True)),
                ('max_cpc', models.IntegerField(blank=True)),
                ('impressions', models.IntegerField(blank=True)),
                ('action', models.CharField(blank=True, default='Select action', max_length=20)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.AdwordsCampaignGroup')),
            ],
            options={
                'db_table': 'adwords_campaign_keywords_rule_engine',
            },
        ),
        migrations.CreateModel(
            name='AdwordsCampaignRuleEngine_adgroups',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group_id', models.CharField(max_length=255, null=True, unique=True)),
                ('target_date', models.DateField(auto_now=True)),
                ('max_ctr', models.IntegerField(blank=True, default=-999)),
                ('location', models.CharField(blank=True, max_length=70)),
                ('action', models.CharField(blank=True, default='Select action', max_length=20)),
                ('campaign', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.AdwordsCampaign')),
            ],
            options={
                'db_table': 'adwords_campaign_adgroups_rule_engine',
            },
        ),
        migrations.CreateModel(
            name='AdwordsCampaignKeywords',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('keyword_id', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('text', models.CharField(max_length=255)),
                ('clicks', models.IntegerField(default=1)),
                ('impressions', models.IntegerField(default=1)),
                ('max_cpc', models.IntegerField(default=1)),
                ('status', models.CharField(blank=True, choices=[('E', 'ENABLED'), ('D', 'DELETED'), ('P', 'PAUSED')], default='P', max_length=10, null=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='myproject.AdwordsCampaignGroup')),
            ],
            options={
                'db_table': 'adwords_campaign_keywords',
            },
        ),
    ]
