30 lines
1.5 KiB
Python
30 lines
1.5 KiB
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import django.db.models.deletion
|
||
|
|
from django.db import migrations, models
|
||
|
|
|
||
|
|
|
||
|
|
class Migration(migrations.Migration):
|
||
|
|
dependencies = [
|
||
|
|
("graph", "0002_graphnoderun_visit_index"),
|
||
|
|
]
|
||
|
|
|
||
|
|
operations = [
|
||
|
|
migrations.CreateModel(
|
||
|
|
name="GraphApproval",
|
||
|
|
fields=[
|
||
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||
|
|
("status", models.CharField(choices=[("PENDING", "Pending"), ("APPROVED", "Approved"), ("REJECTED", "Rejected")], default="PENDING", max_length=32)),
|
||
|
|
("reason", models.CharField(max_length=160)),
|
||
|
|
("payload", models.JSONField(blank=True, default=dict)),
|
||
|
|
("requested_by", models.CharField(default="graph_runtime", max_length=120)),
|
||
|
|
("decided_by", models.CharField(blank=True, max_length=120)),
|
||
|
|
("decided_at", models.DateTimeField(blank=True, null=True)),
|
||
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
||
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
||
|
|
("graph_run", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="approvals", to="graph.graphrun")),
|
||
|
|
("node_run", models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="approvals", to="graph.graphnoderun")),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
]
|