davidtran999 commited on
Commit
0b9fc64
·
verified ·
1 Parent(s): 9e39729

Upload backend/core/migrations/0009_ingestionjob.py with huggingface_hub

Browse files
backend/core/migrations/0009_ingestionjob.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from django.db import migrations, models
2
+ import uuid
3
+
4
+
5
+ class Migration(migrations.Migration):
6
+
7
+ dependencies = [
8
+ ("core", "0008_ocr_fields"),
9
+ ]
10
+
11
+ operations = [
12
+ migrations.CreateModel(
13
+ name="IngestionJob",
14
+ fields=[
15
+ (
16
+ "id",
17
+ models.UUIDField(
18
+ default=uuid.uuid4, editable=False, primary_key=True, serialize=False
19
+ ),
20
+ ),
21
+ ("code", models.CharField(max_length=128)),
22
+ ("filename", models.CharField(max_length=255)),
23
+ ("metadata", models.JSONField(blank=True, default=dict)),
24
+ ("stats", models.JSONField(blank=True, default=dict)),
25
+ (
26
+ "status",
27
+ models.CharField(
28
+ choices=[
29
+ ("pending", "Pending"),
30
+ ("running", "Running"),
31
+ ("completed", "Completed"),
32
+ ("failed", "Failed"),
33
+ ],
34
+ default="pending",
35
+ max_length=20,
36
+ ),
37
+ ),
38
+ ("error_message", models.TextField(blank=True)),
39
+ ("storage_path", models.CharField(blank=True, max_length=512)),
40
+ ("progress", models.PositiveIntegerField(default=0)),
41
+ ("created_at", models.DateTimeField(auto_now_add=True)),
42
+ ("updated_at", models.DateTimeField(auto_now=True)),
43
+ ("started_at", models.DateTimeField(blank=True, null=True)),
44
+ ("finished_at", models.DateTimeField(blank=True, null=True)),
45
+ (
46
+ "document",
47
+ models.ForeignKey(
48
+ blank=True,
49
+ null=True,
50
+ on_delete=models.SET_NULL,
51
+ related_name="ingestion_jobs",
52
+ to="core.legaldocument",
53
+ ),
54
+ ),
55
+ ],
56
+ options={
57
+ "ordering": ("-created_at",),
58
+ },
59
+ ),
60
+ ]
61
+