# Generated by Django 5.2.4 on 2026-06-08 16:15

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0075_update_emx_tt_activity_view'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmxTtActivityJtaVariantFinal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parent_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
                ('child_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
                ('record_state', models.CharField(db_comment='U - update/create, D - Delete', max_length=100)),
            ],
            options={
                'db_table': 'emx_tt_activity_jta_variant_final',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityJtaVariantHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parent_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
                ('child_activity_code', models.CharField(db_comment='variant and jta do in same file', 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_jta_variant_history',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityJtaVariantLast',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parent_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
                ('child_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_jta_variant_last',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityJtaVariantStatic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('parent_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
                ('child_activity_code', models.CharField(db_comment='variant and jta do in same file', max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_jta_variant_static',
            },
        ),
        migrations.RunSQL(  # need the default value for created_at for history
            sql="""
            ALTER TABLE emx_tt_activity_jta_variant_history
            ALTER COLUMN created_at SET DEFAULT now();
            """,
                reverse_sql="""
                ALTER TABLE emx_tt_activity_jta_variant_history
                ALTER COLUMN created_at DROP DEFAULT;
            """,
            ),
    ]
