# Generated by Django 5.2.4 on 2025-08-29 07:32

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0010_ttlocationconstraintprofile_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='AuditTrail',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.PositiveBigIntegerField(null=True)),
                ('type', models.SmallIntegerField(db_comment='1 - admin', default=1)),
                ('ip_address', models.GenericIPAddressField(null=True)),
                ('by_admin_user_id', models.PositiveBigIntegerField(db_comment='when admin impersonate to user do action only have value', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'audit_trail',
            },
        ),
        migrations.CreateModel(
            name='AuditTrailDetails',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('audit_trail', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.audittrail')),
                ('old_data', models.JSONField(null=True)),
                ('new_data', models.JSONField(null=True)),
                ('action', models.CharField(max_length=255)),
                ('remark_string_code', models.TextField(db_comment='translation code in translate file', null=True)),
                ('remark_param', models.TextField(db_comment='every action got own remark to translate, if got param needed, will put here', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'audit_trail_details',
            },
        ),
    ]
