summaryrefslogtreecommitdiffstats
path: root/activities/migrations/0008_postattachment.py
blob: 168ed58436a126e4cb1bb3eb5fa65b2a85016cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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,
            },
        ),
    ]