-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add migration in advance of session properties PR (#21703)
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
posthog/migrations/0404_remove_propertydefinition_property_type_is_valid_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by Django 4.2.11 on 2024-04-21 21:11 | ||
from django.contrib.postgres.operations import AddConstraintNotValid | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("posthog", "0403_plugin_has_private_access"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveConstraint( | ||
model_name="propertydefinition", | ||
name="property_type_is_valid", | ||
), | ||
migrations.AlterField( | ||
model_name="propertydefinition", | ||
name="property_type", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[ | ||
("DateTime", "DateTime"), | ||
("String", "String"), | ||
("Numeric", "Numeric"), | ||
("Boolean", "Boolean"), | ||
("Duration", "Duration"), | ||
], | ||
max_length=50, | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="propertydefinition", | ||
name="type", | ||
field=models.PositiveSmallIntegerField( | ||
choices=[(1, "event"), (2, "person"), (3, "group"), (4, "session")], default=1 | ||
), | ||
), | ||
# changed from migrations.AddConstraint. See migration 0405 for where we validate the constraint | ||
AddConstraintNotValid( | ||
model_name="propertydefinition", | ||
constraint=models.CheckConstraint( | ||
check=models.Q(("property_type__in", ["DateTime", "String", "Numeric", "Boolean", "Duration"])), | ||
name="property_type_is_valid", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters