73 lines
2.6 KiB
Python
73 lines
2.6 KiB
Python
from __future__ import annotations
|
|
|
|
import django.conf
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("jobs", "0003_ai_analysis_cache"),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name="application",
|
|
name="contact_metadata",
|
|
field=models.JSONField(blank=True, default=dict),
|
|
),
|
|
migrations.CreateModel(
|
|
name="ApplicationTimelineEvent",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
|
),
|
|
),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"event_type",
|
|
models.CharField(
|
|
choices=[
|
|
("created", "Aangemaakt"),
|
|
("status_changed", "Status gewijzigd"),
|
|
("notes_updated", "Notitie bijgewerkt"),
|
|
("contact_updated", "Contact bijgewerkt"),
|
|
("snapshot_captured", "Snapshot vastgelegd"),
|
|
],
|
|
max_length=20,
|
|
),
|
|
),
|
|
("metadata", models.JSONField(blank=True, default=dict)),
|
|
(
|
|
"application",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="timeline_events",
|
|
to="jobs.application",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=django.conf.settings.AUTH_USER_MODEL),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["-created_at"],
|
|
},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="applicationtimelineevent",
|
|
index=models.Index(fields=["application", "created_at"], name="jobs_app_timeline_app_idx"),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="applicationtimelineevent",
|
|
index=models.Index(fields=["user", "created_at"], name="jobs_app_timeline_user_idx"),
|
|
),
|
|
]
|