diff --git a/posthog/migrations/0536_user_role_at_organization.py b/posthog/migrations/0536_user_role_at_organization.py new file mode 100644 index 0000000000000..a5ce08257b2c6 --- /dev/null +++ b/posthog/migrations/0536_user_role_at_organization.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.15 on 2024-12-20 16:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("posthog", "0535_alter_hogfunction_type"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="role_at_organization", + field=models.CharField( + blank=True, + choices=[ + ("engineering", "Engineering"), + ("data", "Data"), + ("product", "Product Management"), + ("founder", "Founder"), + ("leadership", "Leadership"), + ("marketing", "Marketing"), + ("sales", "Sales / Success"), + ("other", "Other"), + ], + max_length=64, + null=True, + ), + ), + ] diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt index 4270a16eb7703..e99186a16fd1a 100644 --- a/posthog/migrations/max_migration.txt +++ b/posthog/migrations/max_migration.txt @@ -1 +1 @@ -0535_alter_hogfunction_type +0536_user_role_at_organization diff --git a/posthog/models/user.py b/posthog/models/user.py index 3b25009931c7c..c33dd6d5f7cc3 100644 --- a/posthog/models/user.py +++ b/posthog/models/user.py @@ -31,6 +31,17 @@ class Notifications(TypedDict, total=False): # We don't ned the following attributes in most cases, so we defer them by default DEFERED_ATTRS = ["requested_password_reset_at"] +ROLE_CHOICES = ( + ("engineering", "Engineering"), + ("data", "Data"), + ("product", "Product Management"), + ("founder", "Founder"), + ("leadership", "Leadership"), + ("marketing", "Marketing"), + ("sales", "Sales / Success"), + ("other", "Other"), +) + class UserManager(BaseUserManager): """Define a model manager for User model with no username field.""" @@ -154,6 +165,7 @@ class User(AbstractUser, UUIDClassicModel): default=True, help_text=_("Unselect this to temporarily disable an account."), ) + role_at_organization = models.CharField(max_length=64, choices=ROLE_CHOICES, null=True, blank=True) # Preferences / configuration options