This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("finance", "0002_alter_fact_cost_alter_fact_discount_alter_fact_gross_and_more"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="FormulaExport",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
|
||||
),
|
||||
("context", models.JSONField(default=dict)),
|
||||
("departments", models.JSONField(default=list)),
|
||||
("status", models.CharField(default="queued", max_length=16)),
|
||||
("path", models.CharField(blank=True, max_length=512)),
|
||||
("error", models.CharField(blank=True, max_length=500)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("finished_at", models.DateTimeField(null=True)),
|
||||
("expires_at", models.DateTimeField(null=True)),
|
||||
(
|
||||
"dataset",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="formula_exports",
|
||||
to="finance.dataset",
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="formulaexport",
|
||||
index=models.Index(fields=["status", "created_at"], name="finance_for_status_fa1c07_idx"),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user