From 944158fa81cbac29ca1811819c28861cabd6d658 Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Fri, 21 Feb 2025 01:55:50 +0330 Subject: [PATCH] try to debug database bug --- ...20_remove_securitybreachattemptmodel_ip.py | 17 +++++++++++++++++ .../0021_securitybreachattemptmodel_ip.py | 19 +++++++++++++++++++ backend/account/models.py | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backend/account/migrations/0020_remove_securitybreachattemptmodel_ip.py create mode 100644 backend/account/migrations/0021_securitybreachattemptmodel_ip.py diff --git a/backend/account/migrations/0020_remove_securitybreachattemptmodel_ip.py b/backend/account/migrations/0020_remove_securitybreachattemptmodel_ip.py new file mode 100644 index 0000000..970aee9 --- /dev/null +++ b/backend/account/migrations/0020_remove_securitybreachattemptmodel_ip.py @@ -0,0 +1,17 @@ +# Generated by Django 5.1.2 on 2025-02-20 22:25 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0019_alter_securitybreachattemptmodel_ip'), + ] + + operations = [ + migrations.RemoveField( + model_name='securitybreachattemptmodel', + name='ip', + ), + ] diff --git a/backend/account/migrations/0021_securitybreachattemptmodel_ip.py b/backend/account/migrations/0021_securitybreachattemptmodel_ip.py new file mode 100644 index 0000000..b9d0509 --- /dev/null +++ b/backend/account/migrations/0021_securitybreachattemptmodel_ip.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.2 on 2025-02-20 22:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0020_remove_securitybreachattemptmodel_ip'), + ] + + operations = [ + migrations.AddField( + model_name='securitybreachattemptmodel', + name='ip', + field=models.CharField(default='', max_length=100, verbose_name='آدرس آی\u200cپی'), + preserve_default=False, + ), + ] diff --git a/backend/account/models.py b/backend/account/models.py index c6a57f6..8dcad75 100644 --- a/backend/account/models.py +++ b/backend/account/models.py @@ -217,7 +217,7 @@ def get_location_from_ip(ip_address): return None class SecurityBreachAttemptModel(models.Model): - ip = models.CharField(max_length=100, unique=True, verbose_name="آدرس آی‌پی") + ip = models.CharField(max_length=100, verbose_name="آدرس آی‌پی") country = models.CharField(max_length=40, verbose_name="کشور", blank=True, null=True) region_name = models.CharField(max_length=40, verbose_name="منطقه", blank=True, null=True) city = models.CharField(max_length=40, verbose_name="شهر", blank=True, null=True)