# Generated by Django 6.0 on 2025-12-26 20:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('label', models.CharField(max_length=255)),
                ('description', models.TextField(null=True)),
            ],
            options={
                'db_table': 'marketplace_item',
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('code', models.CharField(help_text='three-letter language code', max_length=3, primary_key=True, serialize=False)),
                ('name', models.CharField(help_text='language name', max_length=255)),
            ],
            options={
                'db_table': 'userprofile_language',
            },
        ),
        migrations.CreateModel(
            name='PayoutMethod',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('user_id', models.IntegerField(db_index=True, null=True)),
                ('default', models.BooleanField(default=False)),
                ('enabled', models.BooleanField(default=True)),
                ('method', models.CharField(choices=[('a', 'AMT'), ('c', 'ACH'), ('t', 'Tango'), ('p', 'PAYPAL')], default='t', max_length=1)),
                ('recipient', models.CharField(blank=True, max_length=200, null=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'userprofile_payoutmethod',
                'ordering': ('-created',),
                'get_latest_by': 'created',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('label', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('cardinality', models.CharField(max_length=9)),
                ('prop_type', models.CharField(choices=[('n', 'numerical'), ('x', 'text'), ('i', 'item')], default='c', max_length=1)),
            ],
            options={
                'db_table': 'marketplace_property',
            },
        ),
        migrations.CreateModel(
            name='THLUser',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('product_id', models.UUIDField()),
                ('product_user_id', models.CharField(max_length=128)),
                ('created', models.DateTimeField()),
                ('last_seen', models.DateTimeField()),
                ('last_country_iso', models.CharField(max_length=2, null=True)),
                ('last_geoname_id', models.IntegerField(null=True)),
                ('last_ip', models.GenericIPAddressField(null=True)),
                ('blocked', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'thl_user',
            },
        ),
        migrations.CreateModel(
            name='THLWall',
            fields=[
                ('uuid', models.UUIDField(primary_key=True, serialize=False)),
                ('source', models.CharField(max_length=2)),
                ('buyer_id', models.CharField(max_length=32, null=True)),
                ('survey_id', models.CharField(max_length=32)),
                ('req_survey_id', models.CharField(max_length=32)),
                ('cpi', models.DecimalField(decimal_places=5, max_digits=8)),
                ('req_cpi', models.DecimalField(decimal_places=5, max_digits=8)),
                ('started', models.DateTimeField()),
                ('finished', models.DateTimeField(null=True)),
                ('status', models.CharField(default=None, max_length=1, null=True)),
                ('status_code_1', models.SmallIntegerField(null=True)),
                ('status_code_2', models.SmallIntegerField(null=True)),
                ('ext_status_code_1', models.CharField(max_length=32, null=True)),
                ('ext_status_code_2', models.CharField(max_length=32, null=True)),
                ('ext_status_code_3', models.CharField(max_length=32, null=True)),
                ('report_value', models.SmallIntegerField(null=True)),
                ('report_notes', models.CharField(max_length=255, null=True)),
                ('adjusted_status', models.CharField(max_length=2, null=True)),
                ('adjusted_cpi', models.DecimalField(decimal_places=5, max_digits=8, null=True)),
                ('adjusted_timestamp', models.DateTimeField(null=True)),
            ],
            options={
                'db_table': 'thl_wall',
            },
        ),
        migrations.CreateModel(
            name='UserAuditLog',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('user_id', models.BigIntegerField()),
                ('created', models.DateTimeField()),
                ('level', models.PositiveSmallIntegerField(default=0)),
                ('event_type', models.CharField(max_length=64)),
                ('event_msg', models.CharField(max_length=256, null=True)),
                ('event_value', models.FloatField(null=True)),
            ],
            options={
                'db_table': 'userhealth_auditlog',
            },
        ),
        migrations.CreateModel(
            name='UserGroup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('user_group', models.UUIDField()),
                ('created', models.DateTimeField()),
            ],
            options={
                'db_table': 'marketplace_usergroup',
            },
        ),
        migrations.CreateModel(
            name='UserHealthIPHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.BigIntegerField()),
                ('ip', models.GenericIPAddressField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('forwarded_ip1', models.GenericIPAddressField(null=True)),
                ('forwarded_ip2', models.GenericIPAddressField(null=True)),
                ('forwarded_ip3', models.GenericIPAddressField(null=True)),
                ('forwarded_ip4', models.GenericIPAddressField(null=True)),
                ('forwarded_ip5', models.GenericIPAddressField(null=True)),
                ('forwarded_ip6', models.GenericIPAddressField(null=True)),
            ],
            options={
                'db_table': 'userhealth_iphistory',
            },
        ),
        migrations.CreateModel(
            name='UserHealthWebSocketIPHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.BigIntegerField()),
                ('ip', models.GenericIPAddressField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('last_seen', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'userhealth_iphistory_ws',
            },
        ),
        migrations.CreateModel(
            name='UserProfileKnowledgeItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('property_id', models.UUIDField()),
                ('session_id', models.UUIDField(null=True)),
                ('question_id', models.UUIDField(null=True)),
                ('country_iso', models.CharField(default='us', max_length=2)),
                ('created', models.DateTimeField(auto_now=True)),
                ('value', models.UUIDField()),
            ],
            options={
                'db_table': 'marketplace_userprofileknowledgeitem',
            },
        ),
        migrations.CreateModel(
            name='UserProfileKnowledgeNumerical',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('property_id', models.UUIDField()),
                ('session_id', models.UUIDField(null=True)),
                ('question_id', models.UUIDField(null=True)),
                ('country_iso', models.CharField(default='us', max_length=2)),
                ('created', models.DateTimeField(auto_now=True)),
                ('value', models.FloatField()),
            ],
            options={
                'db_table': 'marketplace_userprofileknowledgenumerical',
            },
        ),
        migrations.CreateModel(
            name='UserProfileKnowledgeText',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('property_id', models.UUIDField()),
                ('session_id', models.UUIDField(null=True)),
                ('question_id', models.UUIDField(null=True)),
                ('country_iso', models.CharField(default='us', max_length=2)),
                ('created', models.DateTimeField(auto_now=True)),
                ('value', models.CharField(max_length=1024)),
            ],
            options={
                'db_table': 'marketplace_userprofileknowledgetext',
            },
        ),
        migrations.CreateModel(
            name='UserQuestionAnswer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField()),
                ('session_id', models.UUIDField(null=True)),
                ('user_id', models.IntegerField()),
                ('answer', models.JSONField(default=list)),
                ('calc_answer', models.JSONField(default=dict)),
            ],
            options={
                'db_table': 'marketplace_userquestionanswer',
            },
        ),
        migrations.CreateModel(
            name='UserStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveIntegerField()),
                ('key', models.CharField(max_length=255)),
                ('value', models.FloatField(null=True)),
                ('date', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'userprofile_userstat',
            },
        ),
        migrations.CreateModel(
            name='Bribe',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('credit_account_uuid', models.UUIDField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('amount', models.BigIntegerField()),
                ('ext_ref_id', models.CharField(max_length=64, null=True)),
                ('description', models.TextField(null=True)),
                ('data', models.JSONField(null=True)),
            ],
            options={
                'db_table': 'event_bribe',
                'indexes': [models.Index(fields=['created'], name='event_bribe_created_765d8d_idx'), models.Index(fields=['credit_account_uuid'], name='event_bribe_credit__05f3ba_idx'), models.Index(fields=['ext_ref_id'], name='event_bribe_ext_ref_0ddf91_idx')],
            },
        ),
        migrations.CreateModel(
            name='BrokerageProduct',
            fields=[
                ('id', models.UUIDField(primary_key=True, serialize=False)),
                ('id_int', models.BigIntegerField(unique=True)),
                ('name', models.CharField(max_length=255)),
                ('team_id', models.UUIDField(null=True)),
                ('business_id', models.UUIDField(null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('enabled', models.BooleanField(default=True)),
                ('payments_enabled', models.BooleanField(default=True)),
                ('commission', models.DecimalField(decimal_places=6, max_digits=6, null=True)),
                ('redirect_url', models.URLField(null=True)),
                ('grs_domain', models.CharField(max_length=200, null=True)),
                ('profiling_config', models.JSONField(default=dict)),
                ('user_health_config', models.JSONField(default=dict)),
                ('yield_man_config', models.JSONField(default=dict)),
                ('offerwall_config', models.JSONField(default=dict)),
                ('session_config', models.JSONField(default=dict)),
                ('payout_config', models.JSONField(default=dict)),
                ('user_create_config', models.JSONField(default=dict)),
            ],
            options={
                'db_table': 'userprofile_brokerageproduct',
                'unique_together': {('team_id', 'name')},
            },
        ),
        migrations.CreateModel(
            name='BrokerageProductConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=255)),
                ('value', models.JSONField(default=dict)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='thl_django.brokerageproduct')),
            ],
            options={
                'db_table': 'userprofile_brokerageproductconfig',
            },
        ),
        migrations.CreateModel(
            name='BrokerageProductTag',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('product_id', models.BigIntegerField()),
                ('tag', models.CharField(max_length=64)),
            ],
            options={
                'db_table': 'userprofile_brokerageproducttag',
                'unique_together': {('product_id', 'tag')},
            },
        ),
        migrations.CreateModel(
            name='Buyer',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('source', models.CharField(max_length=2)),
                ('code', models.CharField(max_length=128)),
                ('label', models.CharField(max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'marketplace_buyer',
                'indexes': [models.Index(fields=['created'], name='marketplace_created_b168c4_idx')],
                'unique_together': {('source', 'code')},
            },
        ),
        migrations.CreateModel(
            name='BuyerGroup',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('group', models.UUIDField(default=uuid.uuid4)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('buyer', models.OneToOneField(on_delete=django.db.models.deletion.RESTRICT, to='thl_django.buyer')),
            ],
            options={
                'db_table': 'marketplace_buyergroup',
            },
        ),
        migrations.CreateModel(
            name='CashoutMethod',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('is_live', models.BooleanField(default=False)),
                ('provider', models.CharField(max_length=32)),
                ('ext_id', models.CharField(max_length=255, null=True)),
                ('name', models.CharField(max_length=512)),
                ('data', models.JSONField(default=dict)),
                ('user_id', models.PositiveIntegerField(null=True)),
            ],
            options={
                'db_table': 'accounting_cashoutmethod',
                'indexes': [models.Index(fields=['user_id'], name='accounting__user_id_3064f8_idx'), models.Index(fields=['provider', 'ext_id'], name='accounting__provide_b10797_idx')],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('adwords_vertical_id', models.CharField(max_length=8, null=True)),
                ('label', models.CharField(max_length=255)),
                ('path', models.CharField(max_length=1024, null=True)),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='thl_django.category')),
            ],
            options={
                'db_table': 'marketplace_category',
            },
        ),
        migrations.CreateModel(
            name='ConceptTranslation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('concept_id', models.UUIDField()),
                ('language_iso', models.CharField(max_length=3)),
                ('text', models.TextField()),
            ],
            options={
                'db_table': 'marketplace_concepttranslation',
                'indexes': [models.Index(fields=['concept_id'], name='marketplace_concept_e2bbff_idx'), models.Index(fields=['language_iso'], name='marketplace_languag_dad088_idx')],
            },
        ),
        migrations.CreateModel(
            name='Contest',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('product_id', models.UUIDField()),
                ('name', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=2048, null=True)),
                ('country_isos', models.CharField(max_length=1024, null=True)),
                ('contest_type', models.CharField(max_length=32)),
                ('status', models.CharField(max_length=32)),
                ('starts_at', models.DateTimeField()),
                ('terms_and_conditions', models.CharField(max_length=2048, null=True)),
                ('end_condition', models.JSONField()),
                ('prizes', models.JSONField()),
                ('ended_at', models.DateTimeField(null=True)),
                ('end_reason', models.CharField(max_length=32, null=True)),
                ('entry_type', models.CharField(max_length=8, null=True)),
                ('entry_rule', models.JSONField(null=True)),
                ('current_participants', models.IntegerField(null=True)),
                ('current_amount', models.IntegerField(null=True)),
                ('milestone_config', models.JSONField(null=True)),
                ('win_count', models.IntegerField(null=True)),
                ('leaderboard_key', models.CharField(max_length=128, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'contest_contest',
                'indexes': [models.Index(fields=['product_id', 'created_at'], name='contest_con_product_bb9938_idx'), models.Index(fields=['product_id', 'status'], name='contest_con_product_c8fc09_idx')],
            },
        ),
        migrations.CreateModel(
            name='ContestEntry',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('contest_id', models.BigIntegerField()),
                ('amount', models.IntegerField()),
                ('user_id', models.BigIntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'contest_contestentry',
                'indexes': [models.Index(fields=['user_id', 'created_at'], name='contest_con_user_id_8666d0_idx'), models.Index(fields=['contest_id', 'user_id'], name='contest_con_contest_c9ec32_idx')],
            },
        ),
        migrations.CreateModel(
            name='ContestWinner',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('contest_id', models.BigIntegerField()),
                ('user_id', models.BigIntegerField()),
                ('prize', models.JSONField()),
                ('awarded_cash_amount', models.IntegerField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'contest_contestwinner',
                'indexes': [models.Index(fields=['user_id', 'created_at'], name='contest_con_user_id_3215e1_idx'), models.Index(fields=['contest_id'], name='contest_con_contest_bae153_idx')],
            },
        ),
        migrations.CreateModel(
            name='GeoName',
            fields=[
                ('geoname_id', models.PositiveIntegerField(primary_key=True, serialize=False)),
                ('continent_code', models.CharField(max_length=2)),
                ('continent_name', models.CharField(max_length=32)),
                ('country_iso', models.CharField(max_length=2, null=True)),
                ('country_name', models.CharField(max_length=64, null=True)),
                ('subdivision_1_iso', models.CharField(max_length=3, null=True)),
                ('subdivision_1_name', models.CharField(max_length=255, null=True)),
                ('subdivision_2_iso', models.CharField(max_length=3, null=True)),
                ('subdivision_2_name', models.CharField(max_length=255, null=True)),
                ('city_name', models.CharField(max_length=255, null=True)),
                ('metro_code', models.PositiveSmallIntegerField(null=True)),
                ('time_zone', models.CharField(max_length=60, null=True)),
                ('is_in_european_union', models.BooleanField(null=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'thl_geoname',
                'indexes': [models.Index(fields=['updated'], name='thl_geoname_updated_765034_idx')],
            },
        ),
        migrations.CreateModel(
            name='IPInformation',
            fields=[
                ('ip', models.GenericIPAddressField(primary_key=True, serialize=False)),
                ('geoname_id', models.PositiveIntegerField(null=True)),
                ('country_iso', models.CharField(max_length=2, null=True)),
                ('registered_country_iso', models.CharField(max_length=2, null=True)),
                ('is_anonymous', models.BooleanField(null=True)),
                ('is_anonymous_vpn', models.BooleanField(null=True)),
                ('is_hosting_provider', models.BooleanField(null=True)),
                ('is_public_proxy', models.BooleanField(null=True)),
                ('is_tor_exit_node', models.BooleanField(null=True)),
                ('is_residential_proxy', models.BooleanField(null=True)),
                ('autonomous_system_number', models.IntegerField(null=True)),
                ('autonomous_system_organization', models.CharField(max_length=255, null=True)),
                ('domain', models.CharField(blank=True, max_length=255, null=True)),
                ('isp', models.CharField(max_length=255, null=True)),
                ('mobile_country_code', models.CharField(max_length=3, null=True)),
                ('mobile_network_code', models.CharField(max_length=3, null=True)),
                ('network', models.CharField(max_length=56, null=True)),
                ('organization', models.CharField(max_length=255, null=True)),
                ('static_ip_score', models.FloatField(null=True)),
                ('user_type', models.CharField(max_length=64, null=True)),
                ('postal_code', models.CharField(blank=True, max_length=20, null=True)),
                ('latitude', models.DecimalField(decimal_places=6, max_digits=10, null=True)),
                ('longitude', models.DecimalField(decimal_places=6, max_digits=10, null=True)),
                ('accuracy_radius', models.PositiveSmallIntegerField(null=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'thl_ipinformation',
                'indexes': [models.Index(fields=['updated'], name='thl_ipinfor_updated_a17fec_idx')],
            },
        ),
        migrations.CreateModel(
            name='LedgerAccount',
            fields=[
                ('uuid', models.UUIDField(primary_key=True, serialize=False)),
                ('display_name', models.CharField(max_length=64)),
                ('qualified_name', models.CharField(max_length=255, unique=True)),
                ('account_type', models.CharField(max_length=30, null=True)),
                ('normal_balance', models.SmallIntegerField(choices=[(-1, 'credit'), (1, 'debit')])),
                ('reference_type', models.CharField(max_length=30, null=True)),
                ('reference_uuid', models.UUIDField(null=True)),
                ('currency', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'ledger_account',
                'indexes': [models.Index(fields=['reference_uuid'], name='ledger_acco_referen_df449c_idx')],
            },
        ),
        migrations.CreateModel(
            name='LedgerAccountStatement',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('filter_str', models.CharField(max_length=255, null=True)),
                ('effective_at_lower_bound', models.DateTimeField()),
                ('effective_at_upper_bound', models.DateTimeField()),
                ('starting_balance', models.BigIntegerField()),
                ('ending_balance', models.BigIntegerField()),
                ('sql_query', models.TextField(null=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='thl_django.ledgeraccount')),
            ],
            options={
                'db_table': 'ledger_accountstatement',
            },
        ),
        migrations.CreateModel(
            name='LedgerTransaction',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('created', models.DateTimeField()),
                ('ext_description', models.CharField(max_length=255, null=True)),
                ('tag', models.CharField(max_length=255, null=True)),
            ],
            options={
                'db_table': 'ledger_transaction',
                'indexes': [models.Index(fields=['created'], name='ledger_tran_created_091140_idx'), models.Index(fields=['tag'], name='ledger_tran_tag_48e33a_idx')],
            },
        ),
        migrations.CreateModel(
            name='LedgerEntry',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('direction', models.SmallIntegerField(choices=[(-1, 'credit'), (1, 'debit')])),
                ('amount', models.BigIntegerField()),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='account', to='thl_django.ledgeraccount')),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='transaction', to='thl_django.ledgertransaction')),
            ],
            options={
                'db_table': 'ledger_entry',
            },
        ),
        migrations.CreateModel(
            name='LedgerTransactionMetadata',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('key', models.CharField(max_length=30)),
                ('value', models.CharField(max_length=255)),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='thl_django.ledgertransaction')),
            ],
            options={
                'db_table': 'ledger_transactionmetadata',
            },
        ),
        migrations.CreateModel(
            name='Payout',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('debit_account_uuid', models.UUIDField()),
                ('cashout_method_uuid', models.UUIDField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('amount', models.BigIntegerField()),
                ('status', models.CharField(max_length=20, null=True)),
                ('ext_ref_id', models.CharField(max_length=64, null=True)),
                ('payout_type', models.CharField(max_length=14)),
                ('request_data', models.JSONField(null=True)),
                ('order_data', models.JSONField(null=True)),
            ],
            options={
                'db_table': 'event_payout',
                'indexes': [models.Index(fields=['created'], name='event_payou_created_b8b87c_idx'), models.Index(fields=['debit_account_uuid'], name='event_payou_debit_a_3ae0ae_idx'), models.Index(fields=['ext_ref_id'], name='event_payou_ext_ref_a519ac_idx')],
            },
        ),
        migrations.CreateModel(
            name='ProbeLog',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('source', models.CharField(max_length=2)),
                ('survey_id', models.CharField(max_length=32)),
                ('started', models.DateTimeField()),
                ('live_url', models.CharField(max_length=3000)),
                ('har_path', models.CharField(max_length=1000)),
                ('result', models.CharField(max_length=64, null=True)),
            ],
            options={
                'db_table': 'marketplace_probelog',
                'indexes': [models.Index(fields=['source', 'survey_id'], name='marketplace_source_cfaed3_idx'), models.Index(fields=['started'], name='marketplace_started_057aa4_idx')],
            },
        ),
        migrations.CreateModel(
            name='PropertyCategoryAssociation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_id', models.UUIDField(null=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thl_django.category')),
            ],
            options={
                'db_table': 'marketplace_propertycategoryassociation',
            },
        ),
        migrations.CreateModel(
            name='PropertyCountry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_id', models.UUIDField(null=True)),
                ('country_iso', models.CharField(max_length=2)),
                ('gold_standard', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'marketplace_propertycountry',
                'indexes': [models.Index(fields=['property_id'], name='marketplace_propert_3eda38_idx'), models.Index(fields=['country_iso'], name='marketplace_country_5e4fb6_idx')],
            },
        ),
        migrations.CreateModel(
            name='PropertyItemRange',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_id', models.UUIDField(null=True)),
                ('country_iso', models.CharField(max_length=2)),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thl_django.item')),
            ],
            options={
                'db_table': 'marketplace_propertyitemrange',
            },
        ),
        migrations.CreateModel(
            name='PropertyMarketplaceAssociation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_id', models.UUIDField(null=True)),
                ('source', models.CharField(max_length=1)),
                ('question_id', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'marketplace_propertymarketplaceassociation',
                'indexes': [models.Index(fields=['source', 'question_id'], name='marketplace_source_0ad453_idx'), models.Index(fields=['property_id'], name='marketplace_propert_9f1981_idx')],
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('md5sum', models.CharField(max_length=32, null=True)),
                ('country_iso', models.CharField(default='us', max_length=2)),
                ('language_iso', models.CharField(default='eng', max_length=3)),
                ('property_code', models.CharField(max_length=64)),
                ('data', models.JSONField(default=dict)),
                ('is_live', models.BooleanField(default=False)),
                ('custom', models.JSONField(default=dict)),
                ('last_updated', models.DateTimeField(null=True)),
            ],
            options={
                'db_table': 'marketplace_question',
                'indexes': [models.Index(fields=['last_updated'], name='marketplace_last_up_9147b8_idx'), models.Index(fields=['property_code'], name='marketplace_propert_c8d11e_idx')],
            },
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('source', models.CharField(max_length=2)),
                ('survey_id', models.CharField(max_length=32)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('eligibility_criteria', models.JSONField(null=True)),
                ('is_live', models.BooleanField()),
                ('is_recontact', models.BooleanField(default=False)),
                ('buyer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='thl_django.buyer')),
            ],
            options={
                'db_table': 'marketplace_survey',
            },
        ),
        migrations.CreateModel(
            name='SurveyCategory',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('strength', models.FloatField(help_text='Relative relevance or confidence (0–1)')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='thl_django.category')),
                ('survey', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thl_django.survey')),
            ],
            options={
                'db_table': 'marketplace_surveycategory',
            },
        ),
        migrations.CreateModel(
            name='SurveyStat',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('quota_id', models.CharField(max_length=32)),
                ('country_iso', models.CharField(max_length=2)),
                ('cpi', models.DecimalField(decimal_places=5, max_digits=8)),
                ('complete_too_fast_cutoff', models.IntegerField(help_text='Seconds')),
                ('prescreen_conv_alpha', models.FloatField()),
                ('prescreen_conv_beta', models.FloatField()),
                ('conv_alpha', models.FloatField()),
                ('conv_beta', models.FloatField()),
                ('dropoff_alpha', models.FloatField()),
                ('dropoff_beta', models.FloatField()),
                ('completion_time_mu', models.FloatField()),
                ('completion_time_sigma', models.FloatField()),
                ('mobile_eligible_alpha', models.FloatField()),
                ('mobile_eligible_beta', models.FloatField()),
                ('desktop_eligible_alpha', models.FloatField()),
                ('desktop_eligible_beta', models.FloatField()),
                ('tablet_eligible_alpha', models.FloatField()),
                ('tablet_eligible_beta', models.FloatField()),
                ('long_fail_rate', models.FloatField()),
                ('user_report_coeff', models.FloatField()),
                ('recon_likelihood', models.FloatField()),
                ('score_x0', models.FloatField()),
                ('score_x1', models.FloatField()),
                ('score', models.FloatField()),
                ('version', models.PositiveIntegerField(help_text='Bump when logic changes')),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('survey', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='thl_django.survey')),
            ],
            options={
                'db_table': 'marketplace_surveystat',
            },
        ),
        migrations.CreateModel(
            name='TaskAdjustment',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('adjusted_status', models.CharField(max_length=2)),
                ('ext_status_code', models.CharField(max_length=32, null=True)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('alerted', models.DateTimeField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('user_id', models.BigIntegerField()),
                ('wall_uuid', models.UUIDField()),
                ('started', models.DateTimeField()),
                ('source', models.CharField(max_length=2)),
                ('survey_id', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'thl_taskadjustment',
                'indexes': [models.Index(fields=['created'], name='thl_taskadj_created_372998_idx'), models.Index(fields=['user_id'], name='thl_taskadj_user_id_e87483_idx'), models.Index(fields=['wall_uuid'], name='thl_taskadj_wall_uu_c23480_idx')],
            },
        ),
        migrations.CreateModel(
            name='THLSession',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('uuid', models.UUIDField(unique=True)),
                ('user_id', models.BigIntegerField()),
                ('started', models.DateTimeField()),
                ('finished', models.DateTimeField(null=True)),
                ('loi_min', models.SmallIntegerField(null=True)),
                ('loi_max', models.SmallIntegerField(null=True)),
                ('user_payout_min', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('user_payout_max', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('country_iso', models.CharField(max_length=2, null=True)),
                ('device_type', models.SmallIntegerField(null=True)),
                ('ip', models.GenericIPAddressField(null=True)),
                ('status', models.CharField(default=None, max_length=1, null=True)),
                ('status_code_1', models.SmallIntegerField(null=True)),
                ('status_code_2', models.SmallIntegerField(null=True)),
                ('payout', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('user_payout', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('adjusted_status', models.CharField(max_length=2, null=True)),
                ('adjusted_payout', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('adjusted_user_payout', models.DecimalField(decimal_places=2, max_digits=5, null=True)),
                ('adjusted_timestamp', models.DateTimeField(null=True)),
                ('url_metadata', models.JSONField(null=True)),
            ],
            options={
                'db_table': 'thl_session',
                'indexes': [models.Index(fields=['user_id', 'started'], name='thl_session_user_id_72123d_idx'), models.Index(fields=['started'], name='thl_session_started_d5984e_idx'), models.Index(fields=['country_iso'], name='thl_session_country_33a433_idx'), models.Index(fields=['status'], name='thl_session_status_d578b7_idx'), models.Index(fields=['status_code_1'], name='thl_session_status__4c18db_idx'), models.Index(condition=models.Q(('adjusted_status__isnull', False)), fields=['adjusted_status'], name='thl_session_adj_status_nn_idx'), models.Index(condition=models.Q(('adjusted_timestamp__isnull', False)), fields=['adjusted_timestamp'], name='thl_session_adj_ts_nn_idx'), models.Index(fields=['device_type'], name='thl_session_device__5baa4f_idx'), models.Index(fields=['ip'], name='thl_session_ip_0bb4e0_idx')],
            },
        ),
        migrations.CreateModel(
            name='THLUserMetadata',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.RESTRICT, primary_key=True, serialize=False, to='thl_django.thluser')),
                ('email_address', models.CharField(max_length=320, null=True)),
                ('email_sha256', models.CharField(max_length=64, null=True)),
                ('email_sha1', models.CharField(max_length=40, null=True)),
                ('email_md5', models.CharField(max_length=32, null=True)),
            ],
            options={
                'db_table': 'thl_usermetadata',
            },
        ),
        migrations.AddIndex(
            model_name='thluser',
            index=models.Index(fields=['created'], name='thl_user_created_4f8f22_idx'),
        ),
        migrations.AddIndex(
            model_name='thluser',
            index=models.Index(fields=['last_seen'], name='thl_user_last_se_fe5137_idx'),
        ),
        migrations.AddIndex(
            model_name='thluser',
            index=models.Index(fields=['last_country_iso'], name='thl_user_last_co_ece962_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='thluser',
            unique_together={('product_id', 'product_user_id')},
        ),
        migrations.AddField(
            model_name='thlwall',
            name='session',
            field=models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='session', to='thl_django.thlsession'),
        ),
        migrations.AddIndex(
            model_name='userauditlog',
            index=models.Index(fields=['created'], name='userhealth__created_633ca3_idx'),
        ),
        migrations.AddIndex(
            model_name='userauditlog',
            index=models.Index(fields=['user_id', 'created'], name='userhealth__user_id_e64509_idx'),
        ),
        migrations.AddIndex(
            model_name='userauditlog',
            index=models.Index(fields=['level', 'created'], name='userhealth__level_17f32e_idx'),
        ),
        migrations.AddIndex(
            model_name='userauditlog',
            index=models.Index(fields=['event_type', 'created'], name='userhealth__event_t_a45197_idx'),
        ),
        migrations.AddIndex(
            model_name='usergroup',
            index=models.Index(fields=['created'], name='marketplace_created_eecfde_idx'),
        ),
        migrations.AddIndex(
            model_name='usergroup',
            index=models.Index(fields=['user_id'], name='marketplace_user_id_a9b3ed_idx'),
        ),
        migrations.AddIndex(
            model_name='usergroup',
            index=models.Index(fields=['user_group'], name='marketplace_user_gr_47fab2_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='usergroup',
            unique_together={('user_id', 'user_group')},
        ),
        migrations.AddIndex(
            model_name='userhealthiphistory',
            index=models.Index(fields=['user_id', 'created'], name='userhealth__user_id_0f7e18_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthiphistory',
            index=models.Index(fields=['created'], name='userhealth__created_3cd6b7_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthiphistory',
            index=models.Index(fields=['ip'], name='userhealth__ip_eb3911_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthwebsocketiphistory',
            index=models.Index(fields=['user_id', 'created'], name='userhealth__user_id_c11198_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthwebsocketiphistory',
            index=models.Index(fields=['user_id', 'last_seen'], name='userhealth__user_id_1e0473_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthwebsocketiphistory',
            index=models.Index(fields=['created'], name='userhealth__created_0b3299_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthwebsocketiphistory',
            index=models.Index(fields=['last_seen'], name='userhealth__last_se_740e03_idx'),
        ),
        migrations.AddIndex(
            model_name='userhealthwebsocketiphistory',
            index=models.Index(fields=['ip'], name='userhealth__ip_4f31d3_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgeitem',
            index=models.Index(fields=['user_id'], name='marketplace_user_id_30ee59_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgeitem',
            index=models.Index(fields=['created'], name='marketplace_created_f5aa37_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgeitem',
            index=models.Index(fields=['property_id'], name='marketplace_propert_e74b55_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgenumerical',
            index=models.Index(fields=['user_id'], name='marketplace_user_id_8c520e_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgenumerical',
            index=models.Index(fields=['created'], name='marketplace_created_6185aa_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgenumerical',
            index=models.Index(fields=['property_id'], name='marketplace_propert_09a69d_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgetext',
            index=models.Index(fields=['user_id'], name='marketplace_user_id_29dcc6_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgetext',
            index=models.Index(fields=['created'], name='marketplace_created_842729_idx'),
        ),
        migrations.AddIndex(
            model_name='userprofileknowledgetext',
            index=models.Index(fields=['property_id'], name='marketplace_propert_72d583_idx'),
        ),
        migrations.AddField(
            model_name='userquestionanswer',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='thl_django.question'),
        ),
        migrations.AddIndex(
            model_name='userstat',
            index=models.Index(fields=['date'], name='userprofile_date_ec0d70_idx'),
        ),
        migrations.AddIndex(
            model_name='userstat',
            index=models.Index(fields=['user_id'], name='userprofile_user_id_e1f8da_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='userstat',
            unique_together={('key', 'user_id')},
        ),
        migrations.AlterUniqueTogether(
            name='brokerageproductconfig',
            unique_together={('product', 'key')},
        ),
        migrations.AddIndex(
            model_name='buyergroup',
            index=models.Index(fields=['created'], name='marketplace_created_ff147a_idx'),
        ),
        migrations.AddIndex(
            model_name='buyergroup',
            index=models.Index(fields=['group'], name='marketplace_group_4d716b_idx'),
        ),
        migrations.AddIndex(
            model_name='ledgeraccountstatement',
            index=models.Index(fields=['account', 'filter_str', 'effective_at_lower_bound'], name='ledger_acco_account_32b783_idx'),
        ),
        migrations.AddIndex(
            model_name='ledgertransactionmetadata',
            index=models.Index(fields=['key', 'value'], name='ledger_tran_key_4e20eb_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='ledgertransactionmetadata',
            unique_together={('transaction', 'key')},
        ),
        migrations.AddIndex(
            model_name='propertycategoryassociation',
            index=models.Index(fields=['property_id'], name='marketplace_propert_bf7dff_idx'),
        ),
        migrations.AddIndex(
            model_name='propertyitemrange',
            index=models.Index(fields=['country_iso', 'property_id'], name='marketplace_country_bbc7ce_idx'),
        ),
        migrations.AddIndex(
            model_name='survey',
            index=models.Index(fields=['source', 'is_live'], name='marketplace_source_c2ce68_idx'),
        ),
        migrations.AddIndex(
            model_name='survey',
            index=models.Index(condition=models.Q(('is_live', True)), fields=['source'], name='survey_live_by_source'),
        ),
        migrations.AddIndex(
            model_name='survey',
            index=models.Index(fields=['created_at'], name='marketplace_created_6b8446_idx'),
        ),
        migrations.AddIndex(
            model_name='survey',
            index=models.Index(fields=['updated_at'], name='marketplace_updated_414ab2_idx'),
        ),
        migrations.AddConstraint(
            model_name='survey',
            constraint=models.UniqueConstraint(fields=('source', 'survey_id'), name='uniq_survey_source_survey_id'),
        ),
        migrations.AddConstraint(
            model_name='surveycategory',
            constraint=models.UniqueConstraint(fields=('survey', 'category'), name='uniq_survey_category'),
        ),
        migrations.AddIndex(
            model_name='surveystat',
            index=models.Index(fields=['updated_at'], name='marketplace_updated_439a2d_idx'),
        ),
        migrations.AddConstraint(
            model_name='surveystat',
            constraint=models.UniqueConstraint(fields=('survey', 'quota_id', 'country_iso', 'version'), name='uniq_surveystat_survey_quota_country_version'),
        ),
        migrations.AddIndex(
            model_name='thlusermetadata',
            index=models.Index(fields=['email_address'], name='thl_usermet_email_a_2414aa_idx'),
        ),
        migrations.AddIndex(
            model_name='thlusermetadata',
            index=models.Index(fields=['email_sha256'], name='thl_usermet_email_s_b37322_idx'),
        ),
        migrations.AddIndex(
            model_name='thlusermetadata',
            index=models.Index(fields=['email_sha1'], name='thl_usermet_email_s_816978_idx'),
        ),
        migrations.AddIndex(
            model_name='thlusermetadata',
            index=models.Index(fields=['email_md5'], name='thl_usermet_email_m_deff9d_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(fields=['started'], name='thl_wall_started_091924_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(fields=['source', 'survey_id', 'started'], name='thl_wall_source_016b11_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(fields=['source', 'status'], name='thl_wall_source_a6d26f_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(fields=['source', 'status_code_1'], name='thl_wall_source_feb05b_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(condition=models.Q(('adjusted_status__isnull', False)), fields=['adjusted_status'], name='thl_wall_adj_status_nn_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(condition=models.Q(('adjusted_timestamp__isnull', False)), fields=['adjusted_timestamp'], name='thl_wall_adj_ts_nn_idx'),
        ),
        migrations.AddIndex(
            model_name='thlwall',
            index=models.Index(fields=['cpi'], name='thl_wall_cpi_0481c1_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='thlwall',
            unique_together={('session', 'source', 'survey_id')},
        ),
        migrations.AddIndex(
            model_name='userquestionanswer',
            index=models.Index(fields=['user_id', 'question_id', '-created'], name='marketplace_user_id_3c045f_idx'),
        ),
        migrations.AddIndex(
            model_name='userquestionanswer',
            index=models.Index(fields=['created'], name='marketplace_created_336ac8_idx'),
        ),
    ]
