add missing migration
This commit is contained in:
parent
6f5f1bfd63
commit
d53e893c90
1 changed files with 70 additions and 0 deletions
|
@ -0,0 +1,70 @@
|
|||
# Generated by Django 4.2.8 on 2023-12-27 20:09
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("users", "0017_mastodon_site_username_bd2db5_idx"),
|
||||
("journal", "0020_shelflogentry_unique_shelf_log_entry"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="PieceInteraction",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("target_type", models.CharField(max_length=50)),
|
||||
("interaction_type", models.CharField(max_length=50)),
|
||||
(
|
||||
"created_time",
|
||||
models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
(
|
||||
"identity",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="interactions",
|
||||
to="users.apidentity",
|
||||
),
|
||||
),
|
||||
(
|
||||
"target",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="interactions",
|
||||
to="journal.piece",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"indexes": [
|
||||
models.Index(
|
||||
fields=["identity", "interaction_type", "created_time"],
|
||||
name="journal_pie_identit_bd12d3_idx",
|
||||
),
|
||||
models.Index(
|
||||
fields=["target", "interaction_type", "created_time"],
|
||||
name="journal_pie_target__f943ca_idx",
|
||||
),
|
||||
],
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="pieceinteraction",
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=("identity", "interaction_type", "target"),
|
||||
name="unique_interaction",
|
||||
),
|
||||
),
|
||||
]
|
Loading…
Add table
Reference in a new issue