# Generated by Django 5.2.4 on 2026-06-08 17:02

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0077_emx_tt_activity_jta_variant_view'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmxTtActivityLocationFinal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('location_code', models.CharField(max_length=255)),
                ('record_state', models.CharField(db_comment='U - update/create, D - Delete', max_length=100)),
            ],
            options={
                'db_table': 'emx_tt_activity_location_final',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityLocationHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('location_code', models.CharField(max_length=255)),
                ('record_state', models.CharField(db_comment='U - update/create, D - Delete', max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
            ],
            options={
                'db_table': 'emx_tt_activity_location_history',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityLocationLast',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('location_code', models.CharField(max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_location_last',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityLocationStatic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('location_code', models.CharField(max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_location_static',
            },
        ),
        migrations.RunSQL(  # need the default value for created_at for history
        sql="""
        ALTER TABLE emx_tt_activity_location_history
        ALTER COLUMN created_at SET DEFAULT now();
        """,
            reverse_sql="""
            ALTER TABLE emx_tt_activity_location_history
            ALTER COLUMN created_at DROP DEFAULT;
        """,
        ),
    ]
