# Generated by Django 4.2.13 on 2024-06-13 13:10

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("users", "0001_initial_0_10"),
        ("catalog", "0001_initial_0_10"),
        ("journal", "0001_initial_0_10"),
    ]

    operations = [
        migrations.CreateModel(
            name="Note",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "remote_id",
                    models.CharField(default=None, max_length=200, null=True),
                ),
                ("title", models.TextField(blank=True, default=None, null=True)),
                ("content", models.TextField()),
                ("sensitive", models.BooleanField(default=False)),
                ("attachments", models.JSONField(default=list)),
                (
                    "item",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="users.apidentity",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
    ]
