Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

UN-3186 [FEAT] Add is_deprecated field to User model for OAuth email change handling (#1763)

ali5c18b2794e01
diff --git a/backend/account_v2/migrations/0003_user_is_deprecated.py b/backend/account_v2/migrations/0003_user_is_deprecated.py
new file mode 100644
index 000000000..7ae9265d9
--- /dev/null
+++ b/backend/account_v2/migrations/0003_user_is_deprecated.py
@@ -0,0 +1,21 @@
+# Generated by Django 4.2.1 on 2025-01-29
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("account_v2", "0002_user_auth_provider"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="user",
+ name="is_deprecated",
+ field=models.BooleanField(
+ db_index=True,
+ default=False,
+ help_text="Marks old user records when OAuth user changes email",
+ ),
+ ),
+ ]
diff --git a/backend/account_v2/models.py b/backend/account_v2/models.py
index f0ebf71da..af2bf6592 100644
--- a/backend/account_v2/models.py
+++ b/backend/account_v2/models.py
@@ -54,6 +54,11 @@ class User(AbstractUser):
# Third Party Authentication User ID
user_id = models.CharField()
+ is_deprecated = models.BooleanField(
+ default=False,
+ db_index=True,
+ help_text="Marks old user records when OAuth user changes email",
+ )
project_storage_created = models.BooleanField(default=False)
created_by = models.ForeignKey(
"User",