backend/passfinder/users/migrations/0002_userpreference.py

69 lines
2.2 KiB
Python
Raw Normal View History

# Generated by Django 4.2.1 on 2023-05-22 14:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("events", "0016_remove_basepoint_location_remove_city_location_and_more"),
("users", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="UserPreference",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"type",
models.CharField(
choices=[
("like", "Like"),
("dislike", "Dislike"),
("favorite", "Favorite"),
("unfavorite", "Unfavorite"),
("view", "View"),
("ignore", "Ignore"),
],
max_length=10,
),
),
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
(
"point",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="user_preferences",
to="events.basepoint",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="preferences",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"indexes": [
models.Index(
fields=["user", "point"], name="users_userp_user_id_7550b0_idx"
)
],
},
),
]