summaryrefslogtreecommitdiffstats
path: root/activities/migrations
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-13 18:42:47 -0700
committerAndrew Godwin2022-11-13 18:43:09 -0700
commitddb3436275d3f02183f515c38cd3193cd1dfe2f4 (patch)
tree8902d4f085ad6d8323f43af20ca497d291e4d28a /activities/migrations
parent68c156fd2758da5831bd83bfb1249dd014d78177 (diff)
downloadtakahe-ddb3436275d3f02183f515c38cd3193cd1dfe2f4.tar.gz
takahe-ddb3436275d3f02183f515c38cd3193cd1dfe2f4.tar.bz2
takahe-ddb3436275d3f02183f515c38cd3193cd1dfe2f4.zip
Boosting! Incoming, anyway.
Diffstat (limited to 'activities/migrations')
-rw-r--r--activities/migrations/0004_rename_authored_post_published_alter_fanout_type_and_more.py126
1 files changed, 126 insertions, 0 deletions
diff --git a/activities/migrations/0004_rename_authored_post_published_alter_fanout_type_and_more.py b/activities/migrations/0004_rename_authored_post_published_alter_fanout_type_and_more.py
new file mode 100644
index 0000000..7972f18
--- /dev/null
+++ b/activities/migrations/0004_rename_authored_post_published_alter_fanout_type_and_more.py
@@ -0,0 +1,126 @@
+# Generated by Django 4.1.3 on 2022-11-14 00:41
+
+import django.db.models.deletion
+import django.utils.timezone
+from django.db import migrations, models
+
+import activities.models.post_interaction
+import stator.models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("users", "0002_identity_public_key_id"),
+ ("activities", "0003_alter_post_object_uri"),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name="post",
+ old_name="authored",
+ new_name="published",
+ ),
+ migrations.AlterField(
+ model_name="fanout",
+ name="type",
+ field=models.CharField(
+ choices=[("post", "Post"), ("interaction", "Interaction")],
+ max_length=100,
+ ),
+ ),
+ migrations.AlterField(
+ model_name="timelineevent",
+ name="subject_post",
+ field=models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="timeline_events",
+ to="activities.post",
+ ),
+ ),
+ migrations.CreateModel(
+ name="PostInteraction",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("state_ready", models.BooleanField(default=True)),
+ ("state_changed", models.DateTimeField(auto_now_add=True)),
+ ("state_attempted", models.DateTimeField(blank=True, null=True)),
+ ("state_locked_until", models.DateTimeField(blank=True, null=True)),
+ (
+ "state",
+ stator.models.StateField(
+ choices=[("new", "new"), ("fanned_out", "fanned_out")],
+ default="new",
+ graph=activities.models.post_interaction.PostInteractionStates,
+ max_length=100,
+ ),
+ ),
+ (
+ "object_uri",
+ models.CharField(
+ blank=True, max_length=500, null=True, unique=True
+ ),
+ ),
+ (
+ "type",
+ models.CharField(
+ choices=[("like", "Like"), ("boost", "Boost")], max_length=100
+ ),
+ ),
+ ("published", models.DateTimeField(default=django.utils.timezone.now)),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ (
+ "identity",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="interactions",
+ to="users.identity",
+ ),
+ ),
+ (
+ "post",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="interactions",
+ to="activities.post",
+ ),
+ ),
+ ],
+ options={
+ "index_together": {("type", "identity", "post")},
+ },
+ ),
+ migrations.AddField(
+ model_name="fanout",
+ name="subject_post_interaction",
+ field=models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="fan_outs",
+ to="activities.postinteraction",
+ ),
+ ),
+ migrations.AddField(
+ model_name="timelineevent",
+ name="subject_post_interaction",
+ field=models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="timeline_events",
+ to="activities.postinteraction",
+ ),
+ ),
+ ]