diff options
author | Andrew Godwin | 2022-11-11 23:04:43 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-11 23:04:43 -0700 |
commit | 8fd5a9292c7d3aac352d3c0e96288bff8a79cb47 (patch) | |
tree | 3a9199c1d35a77d209cf424141fd4aa0e0694118 /activities/migrations | |
parent | feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1 (diff) | |
download | takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.gz takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.bz2 takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.zip |
Posting and fan-out both working
Diffstat (limited to 'activities/migrations')
-rw-r--r-- | activities/migrations/0001_initial.py | 2 | ||||
-rw-r--r-- | activities/migrations/0002_fan_out.py | 103 |
2 files changed, 104 insertions, 1 deletions
diff --git a/activities/migrations/0001_initial.py b/activities/migrations/0001_initial.py index a97146d..0b350ef 100644 --- a/activities/migrations/0001_initial.py +++ b/activities/migrations/0001_initial.py @@ -28,7 +28,7 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("state_ready", models.BooleanField(default=False)), + ("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)), diff --git a/activities/migrations/0002_fan_out.py b/activities/migrations/0002_fan_out.py new file mode 100644 index 0000000..f3b626e --- /dev/null +++ b/activities/migrations/0002_fan_out.py @@ -0,0 +1,103 @@ +# Generated by Django 4.1.3 on 2022-11-12 05:36 + +import django.db.models.deletion +import django.utils.timezone +from django.db import migrations, models + +import activities.models.fan_out +import stator.models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0001_initial"), + ("activities", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="post", + name="authored", + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AlterField( + model_name="post", + name="author", + field=models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + related_name="posts", + to="users.identity", + ), + ), + migrations.AlterField( + model_name="post", + name="mentions", + field=models.ManyToManyField( + blank=True, related_name="posts_mentioning", to="users.identity" + ), + ), + migrations.AlterField( + model_name="post", + name="to", + field=models.ManyToManyField( + blank=True, related_name="posts_to", to="users.identity" + ), + ), + migrations.CreateModel( + name="FanOut", + 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"), ("sent", "sent")], + default="new", + graph=activities.models.fan_out.FanOutStates, + max_length=100, + ), + ), + ( + "type", + models.CharField( + choices=[("post", "Post"), ("boost", "Boost")], max_length=100 + ), + ), + ("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="fan_outs", + to="users.identity", + ), + ), + ( + "subject_post", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="fan_outs", + to="activities.post", + ), + ), + ], + options={ + "abstract": False, + }, + ), + ] |