Skip to content

Commit

Permalink
Merge pull request #174 from theopensystemslab/oz/itl-lookup-table
Browse files Browse the repository at this point in the history
feat: make itl_lookup fields required
  • Loading branch information
zz-hh-aa authored Dec 13, 2024
2 parents 20b9755 + 230b21b commit d70d8f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 0 additions & 3 deletions app/data/itlRepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ describe("itlRepo", () => {
expect(prisma.itlLookup.findFirstOrThrow).toHaveBeenCalledWith({
where: {
postcode: postcodeDistrict,
itl3: {
not: null,
},
},
select: {
itl3: true,
Expand Down
3 changes: 0 additions & 3 deletions app/data/itlRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const getItl3ByPostcodeDistrict = async (
const { itl3 } = await prisma.itlLookup.findFirstOrThrow({
where: {
postcode: postcodeDistrict,
itl3: {
not: null,
},
},
select: {
itl3: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "itl_lookup" ALTER COLUMN "postcode" SET NOT NULL,
ALTER COLUMN "district" SET NOT NULL,
ALTER COLUMN "areacode" SET NOT NULL,
ALTER COLUMN "itl3" SET NOT NULL;
8 changes: 4 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ model HPI {
}

model ItlLookup {
postcode String?
district String?
areacode String?
itl3 String?
postcode String
district String
areacode String
itl3 String
id Int @id @default(autoincrement())
@@map("itl_lookup")
Expand Down

0 comments on commit d70d8f9

Please sign in to comment.