Skip to content

Commit

Permalink
Increase Element model varchar limits (#3912)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored Apr 8, 2021
1 parent a2ff10a commit 305e5f7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ auth: 0011_update_proxy_permissions
axes: 0006_remove_accesslog_trusted
contenttypes: 0002_remove_content_type_name
ee: 0002_hook
posthog: 0143_user_uuid
posthog: 0144_increase_element_varchars
rest_hooks: 0002_swappable_hook_model
sessions: 0001_initial
social_django: 0008_partial_timestamp
33 changes: 33 additions & 0 deletions posthog/migrations/0144_increase_element_varchars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.0.11 on 2021-04-08 14:16

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("posthog", "0143_user_uuid"),
]

operations = [
migrations.AlterField(
model_name="element",
name="attr_class",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(blank=True, max_length=10000), blank=True, null=True, size=None
),
),
migrations.AlterField(
model_name="element", name="attr_id", field=models.CharField(blank=True, max_length=10000, null=True),
),
migrations.AlterField(
model_name="element", name="href", field=models.CharField(blank=True, max_length=10000, null=True),
),
migrations.AlterField(
model_name="element", name="tag_name", field=models.CharField(blank=True, max_length=1000, null=True),
),
migrations.AlterField(
model_name="element", name="text", field=models.CharField(blank=True, max_length=10000, null=True),
),
]
10 changes: 5 additions & 5 deletions posthog/models/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

class Element(models.Model):
USEFUL_ELEMENTS = ["a", "button", "input", "select", "textarea", "label"]
text: models.CharField = models.CharField(max_length=400, null=True, blank=True)
tag_name: models.CharField = models.CharField(max_length=400, null=True, blank=True)
href: models.CharField = models.CharField(max_length=2048, null=True, blank=True)
attr_id: models.CharField = models.CharField(max_length=400, null=True, blank=True)
attr_class = ArrayField(models.CharField(max_length=200, blank=True), null=True, blank=True)
text: models.CharField = models.CharField(max_length=10_000, null=True, blank=True)
tag_name: models.CharField = models.CharField(max_length=1_000, null=True, blank=True)
href: models.CharField = models.CharField(max_length=10_000, null=True, blank=True)
attr_id: models.CharField = models.CharField(max_length=10_000, null=True, blank=True)
attr_class = ArrayField(models.CharField(max_length=10_000, blank=True), null=True, blank=True)
nth_child: models.IntegerField = models.IntegerField(null=True, blank=True)
nth_of_type: models.IntegerField = models.IntegerField(null=True, blank=True)
attributes: JSONField = JSONField(default=dict)
Expand Down

0 comments on commit 305e5f7

Please sign in to comment.