Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change actstream models ids type from Char to UUID #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions actstream/migrations/0004_auto_20191227_1245.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 2.1.11 on 2019-12-27 12:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('actstream', '0003_add_follow_flag'),
]

operations = [
migrations.AlterField(
model_name='action',
name='action_object_object_id',
field=models.UUIDField(blank=True, db_index=True, null=True),
),
migrations.AlterField(
model_name='action',
name='actor_object_id',
field=models.UUIDField(db_index=True),
),
migrations.AlterField(
model_name='action',
name='target_object_id',
field=models.UUIDField(blank=True, db_index=True, null=True),
),
migrations.AlterField(
model_name='follow',
name='object_id',
field=models.UUIDField(db_index=True),
),
]
12 changes: 6 additions & 6 deletions actstream/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Follow(models.Model):
content_type = models.ForeignKey(
ContentType, on_delete=models.CASCADE, db_index=True
)
object_id = models.CharField(max_length=255, db_index=True)
object_id = models.UUIDField(db_index=True)
follow_object = GenericForeignKey()
actor_only = models.BooleanField(
"Only follow actions where "
Expand Down Expand Up @@ -75,7 +75,7 @@ class Action(models.Model):
ContentType, related_name='actor',
on_delete=models.CASCADE, db_index=True
)
actor_object_id = models.CharField(max_length=255, db_index=True)
actor_object_id = models.UUIDField(db_index=True)
actor = GenericForeignKey('actor_content_type', 'actor_object_id')

verb = models.CharField(max_length=255, db_index=True)
Expand All @@ -86,8 +86,8 @@ class Action(models.Model):
related_name='target',
on_delete=models.CASCADE, db_index=True
)
target_object_id = models.CharField(
max_length=255, blank=True, null=True, db_index=True
target_object_id = models.UUIDField(
blank=True, null=True, db_index=True
)
target = GenericForeignKey(
'target_content_type',
Expand All @@ -99,8 +99,8 @@ class Action(models.Model):
related_name='action_object',
on_delete=models.CASCADE, db_index=True
)
action_object_object_id = models.CharField(
max_length=255, blank=True, null=True, db_index=True
action_object_object_id = models.UUIDField(
blank=True, null=True, db_index=True
)
action_object = GenericForeignKey(
'action_object_content_type',
Expand Down