# Generated by Django 4.2.20 on 2025-04-02 07:38

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


class Migration(migrations.Migration):

    dependencies = [
        ('system_settings', '0010_alter_paymentgatewayconfig_gateway_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='TradingPlatformServerLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('event_type', models.CharField(choices=[('CONNECT_SUCCESS', 'Connection Successful'), ('CONNECT_FAIL', 'Connection Failed'), ('DISCONNECT', 'Disconnected'), ('HEALTH_CHECK_FAIL', 'Health Check Failed'), ('RECONNECT_ATTEMPT', 'Reconnection Attempt'), ('RECONNECT_SUCCESS', 'Reconnection Successful'), ('RECONNECT_FAIL', 'Reconnection Failed')], db_index=True, max_length=20)),
                ('details', models.TextField(blank=True, help_text='Details about the event, e.g., error message.', null=True)),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='system_settings.tradingplatformserver')),
            ],
            options={
                'verbose_name': 'Trading Platform Server Log',
                'verbose_name_plural': 'Trading Platform Server Logs',
                'db_table': 'system_trading_platform_server_log',
                'ordering': ['-timestamp'],
            },
        ),
    ]
