Skip to content

Commit

Permalink
fix(recap): Updated ProcessingQueue migrations.
Browse files Browse the repository at this point in the history
- Fixed pacer_case_id typo in migration.
- Increased pacer_doc_id length to 64
- Added new field acms_document_guid
- Added new UploadType
  • Loading branch information
albertisfu committed Oct 3, 2023
1 parent 1120791 commit 37d5c1a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.4 on 2023-10-02 18:25
# Generated by Django 4.2.4 on 2023-10-03 18:29

from django.db import migrations, models

Expand All @@ -12,6 +12,15 @@ class Migration(migrations.Migration):
]

operations = [
migrations.AddField(
model_name="processingqueue",
name="acms_document_guid",
field=models.CharField(
blank=True,
help_text="The ID of the document in PACER.",
max_length=64,
),
),
migrations.AlterField(
model_name="pacerhtmlfiles",
name="upload_type",
Expand All @@ -37,6 +46,26 @@ class Migration(migrations.Migration):
help_text="The type of object that is uploaded",
),
),
migrations.AlterField(
model_name="processingqueue",
name="pacer_case_id",
field=models.CharField(
blank=True,
db_index=True,
help_text="The case ID provided by PACER.",
max_length=100,
),
),
migrations.AlterField(
model_name="processingqueue",
name="pacer_doc_id",
field=models.CharField(
blank=True,
db_index=True,
help_text="The ID of the document in PACER.",
max_length=64,
),
),
migrations.AlterField(
model_name="processingqueue",
name="upload_type",
Expand All @@ -62,4 +91,11 @@ class Migration(migrations.Migration):
help_text="The type of object that is uploaded",
),
),
migrations.AddIndex(
model_name="processingqueue",
index=models.Index(
fields=["acms_document_guid"],
name="recap_proce_acms_do_2e7cae_idx",
),
),
]
27 changes: 27 additions & 0 deletions cl/recap/migrations/0013_processingqueue_update.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BEGIN;
--
-- Add field acms_document_guid to processingqueue
--
ALTER TABLE "recap_processingqueue" ADD COLUMN "acms_document_guid" varchar(64) DEFAULT '' NOT NULL;
ALTER TABLE "recap_processingqueue" ALTER COLUMN "acms_document_guid" DROP DEFAULT;
--
-- Alter field upload_type on pacerhtmlfiles
--
-- (no-op)
--
-- Alter field pacer_case_id on processingqueue
--
-- (no-op)
--
-- Alter field pacer_doc_id on processingqueue
--
ALTER TABLE "recap_processingqueue" ALTER COLUMN "pacer_doc_id" TYPE varchar(64);
--
-- Alter field upload_type on processingqueue
--
-- (no-op)
--
-- Create index recap_proce_acms_do_2e7cae_idx on field(s) acms_document_guid of model processingqueue
--
CREATE INDEX "recap_proce_acms_do_2e7cae_idx" ON "recap_processingqueue" ("acms_document_guid");
COMMIT;
10 changes: 9 additions & 1 deletion cl/recap/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,15 @@ class ProcessingQueue(AbstractDateTimeModel):
)
pacer_doc_id = models.CharField(
help_text="The ID of the document in PACER.",
max_length=32, # Same as in RECAP
max_length=64, # Increased to support storing docketEntryId from ACMS.
blank=True,
db_index=True,
)
acms_document_guid = models.CharField(
help_text="The ID of the document in PACER.",
max_length=64,
blank=True,
)
document_number = models.BigIntegerField(
help_text="The docket entry number for the document.",
blank=True,
Expand Down Expand Up @@ -223,6 +228,9 @@ class Meta:
permissions = (
("has_recap_upload_access", "Can upload documents to RECAP."),
)
indexes = [
models.Index(fields=["acms_document_guid"]),
]

@property
def file_contents(self) -> str:
Expand Down

0 comments on commit 37d5c1a

Please sign in to comment.