From 767c0d7dd04e2a162723cc4e051ee96967896ac8 Mon Sep 17 00:00:00 2001 From: Her Email Date: Fri, 8 Dec 2023 16:07:37 -0500 Subject: [PATCH] sync takahe db schema --- .github/workflows/publish-tags.yml | 4 +- takahe/migrations/0001_initial.py | 90 ++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-tags.yml b/.github/workflows/publish-tags.yml index 839134ba..9a053159 100644 --- a/.github/workflows/publish-tags.yml +++ b/.github/workflows/publish-tags.yml @@ -30,7 +30,9 @@ jobs: - name: Overwrite version in code env: REF_NAME: ${{ github.ref_name }} - run: echo '__version__ = "'$REF_NAME'"' > boofilsic/__init__.py + run: | + echo '__version__ = "'$REF_NAME'"' > boofilsic/__init__.py + echo '__neodb_version__ = "'$REF_NAME'"' >> neodb-takahe/takahe/__init__.py - name: Send Discord notification uses: appleboy/discord-action@master diff --git a/takahe/migrations/0001_initial.py b/takahe/migrations/0001_initial.py index 9edff303..a224664e 100644 --- a/takahe/migrations/0001_initial.py +++ b/takahe/migrations/0001_initial.py @@ -723,4 +723,94 @@ class Migration(migrations.Migration): "db_table": "activities_fanout", }, ), + migrations.CreateModel( + name="TimelineEvent", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "type", + models.CharField( + choices=[ + ("post", "Post"), + ("boost", "Boost"), + ("mentioned", "Mentioned"), + ("liked", "Liked"), + ("followed", "Followed"), + ("follow_requested", "Follow Requested"), + ("boosted", "Boosted"), + ("announcement", "Announcement"), + ("identity_created", "Identity Created"), + ], + max_length=100, + ), + ), + ("published", models.DateTimeField(default=django.utils.timezone.now)), + ("seen", models.BooleanField(default=False)), + ("dismissed", models.BooleanField(default=False)), + ("created", models.DateTimeField(auto_now_add=True)), + ( + "identity", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="timeline_events", + to="takahe.identity", + ), + ), + ( + "subject_identity", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="timeline_events_about_us", + to="takahe.identity", + ), + ), + ( + "subject_post", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="timeline_events", + to="takahe.post", + ), + ), + ( + "subject_post_interaction", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="timeline_events", + to="takahe.postinteraction", + ), + ), + ], + options={ + "db_table": "activities_timelineevent", + "indexes": [ + models.Index( + fields=["identity", "type", "subject_post", "subject_identity"], + name="activities__identit_0b93c3_idx", + ), + models.Index( + fields=["identity", "type", "subject_identity"], + name="activities__identit_cc2290_idx", + ), + models.Index( + fields=["identity", "created"], + name="activities__identit_872fbb_idx", + ), + ], + }, + ), ]