Skip to content

Commit

Permalink
getCaseByDocketNumber-dxox-experiment: add more indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Mwindo committed Dec 12, 2024
1 parent 267186c commit 055b14d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const upsertCaseCorrespondences = async (
return {
archived: correspondence.archived,
correspondenceId: correspondence.correspondenceId,
docketNumber: correspondence.docketNumber,
docketNumber: correspondence.docketNumber!,
documentTitle: correspondence.documentTitle,
filedBy: correspondence.filedBy,
filingDate: calculateDate({ dateString: correspondence.filingDate }),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { Kysely } from 'kysely';

export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.createIndex('idx_caseCorrespondence_docketNumber')
.on('dwCaseCorrespondence')
.column('docketNumber')
.execute();

await db.schema
.createIndex('idx_caseDeadline_docketNumber')
.on('dwCaseDeadline')
.column('docketNumber')
.execute();

await db.schema
.createIndex('idx_caseDeadline_deadlineDate')
.on('dwCaseDeadline')
.column('deadlineDate')
.execute();

await db.schema
.createIndex('idx_caseDeadline_sortableDocketNumber')
.on('dwCaseDeadline')
.column('sortableDocketNumber')
.execute();

await db.schema
.createIndex('idx_caseDeadline_associatedJudge')
.on('dwCaseDeadline')
.column('associatedJudge')
.execute();
}

export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.dropIndex('idx_caseDeadline_associatedJudge')
.on('dwCaseDeadline')
.execute();

await db.schema
.dropIndex('idx_caseDeadline_sortableDocketNumber')
.on('dwCaseDeadline')
.execute();

await db.schema
.dropIndex('idx_caseDeadline_deadlineDate')
.on('dwCaseDeadline')
.execute();

await db.schema
.dropIndex('idx_caseDeadline_docketNumber')
.on('dwCaseDeadline')
.execute();

await db.schema
.dropIndex('idx_caseCorrespondence_docketNumber')
.on('dwCaseCorrespondence')
.execute();
}

This file was deleted.

0 comments on commit 055b14d

Please sign in to comment.