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

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0081_emx_tt_activity_staff_view'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmxTtActivityDateFinal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('activity_date', models.CharField(db_comment='using varchar cause want to custom date format', max_length=255)),
                ('record_state', models.CharField(db_comment='U - update/create, D - Delete', max_length=100)),
            ],
            options={
                'db_table': 'emx_tt_activity_date_final',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityDateHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('activity_date', models.CharField(db_comment='using varchar cause want to custom date format', 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_date_history',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityDateLast',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('activity_date', models.CharField(db_comment='using varchar cause want to custom date format', max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_date_last',
            },
        ),
        migrations.CreateModel(
            name='EmxTtActivityDateStatic',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_code', models.CharField(max_length=255)),
                ('activity_date', models.CharField(db_comment='using varchar cause want to custom date format', max_length=255)),
            ],
            options={
                'db_table': 'emx_tt_activity_date_static',
            },
        ),
        migrations.RunSQL(  # need the default value for created_at for history
            sql="""
            ALTER TABLE emx_tt_activity_staff_history
            ALTER COLUMN created_at SET DEFAULT now();
            """,
            reverse_sql="""
                ALTER TABLE emx_tt_activity_staff_history
                ALTER COLUMN created_at DROP DEFAULT;
            """,
        ),
        migrations.RunSQL(  # need the default value for created_at for history
            sql="""
        ALTER TABLE emx_tt_activity_date_history
        ALTER COLUMN created_at SET DEFAULT now();
        """,
            reverse_sql="""
            ALTER TABLE emx_tt_activity_date_history
            ALTER COLUMN created_at DROP DEFAULT;
        """,
        ),
    ]
