diff options
author | Andrew Godwin | 2022-11-16 23:00:10 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-16 23:00:10 -0700 |
commit | 716d8a766ae0c4e2539f2df601269a3203bcd715 (patch) | |
tree | 6fca650c5960b06494ba322d4621727b81bd4fa0 /activities/migrations | |
parent | b13c239213147b7acae4060aff35640d625b5169 (diff) | |
download | takahe-716d8a766ae0c4e2539f2df601269a3203bcd715.tar.gz takahe-716d8a766ae0c4e2539f2df601269a3203bcd715.tar.bz2 takahe-716d8a766ae0c4e2539f2df601269a3203bcd715.zip |
Show post images
Diffstat (limited to 'activities/migrations')
-rw-r--r-- | activities/migrations/0008_postattachment.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/activities/migrations/0008_postattachment.py b/activities/migrations/0008_postattachment.py new file mode 100644 index 0000000..168ed58 --- /dev/null +++ b/activities/migrations/0008_postattachment.py @@ -0,0 +1,69 @@ +# Generated by Django 4.1.3 on 2022-11-17 05:42 + +import django.db.models.deletion +from django.db import migrations, models + +import activities.models.post_attachment +import stator.models + + +class Migration(migrations.Migration): + + dependencies = [ + ("activities", "0007_post_edited"), + ] + + operations = [ + migrations.CreateModel( + name="PostAttachment", + 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"), ("fetched", "fetched")], + default="new", + graph=activities.models.post_attachment.PostAttachmentStates, + max_length=100, + ), + ), + ("mimetype", models.CharField(max_length=200)), + ( + "file", + models.FileField( + blank=True, null=True, upload_to="attachments/%Y/%m/%d/" + ), + ), + ("remote_url", models.CharField(blank=True, max_length=500, null=True)), + ("name", models.TextField(blank=True, null=True)), + ("width", models.IntegerField(blank=True, null=True)), + ("height", models.IntegerField(blank=True, null=True)), + ("focal_x", models.IntegerField(blank=True, null=True)), + ("focal_y", models.IntegerField(blank=True, null=True)), + ("blurhash", models.TextField(blank=True, null=True)), + ( + "post", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="attachments", + to="activities.post", + ), + ), + ], + options={ + "abstract": False, + }, + ), + ] |