diff --git a/app/data/itlRepo.test.ts b/app/data/itlRepo.test.ts index 1b7ba1f..21031a4 100644 --- a/app/data/itlRepo.test.ts +++ b/app/data/itlRepo.test.ts @@ -27,9 +27,6 @@ describe("itlRepo", () => { expect(prisma.itlLookup.findFirstOrThrow).toHaveBeenCalledWith({ where: { postcode: postcodeDistrict, - itl3: { - not: null, - }, }, select: { itl3: true, diff --git a/app/data/itlRepo.ts b/app/data/itlRepo.ts index 656734a..fadb0ba 100644 --- a/app/data/itlRepo.ts +++ b/app/data/itlRepo.ts @@ -7,9 +7,6 @@ const getItl3ByPostcodeDistrict = async ( const { itl3 } = await prisma.itlLookup.findFirstOrThrow({ where: { postcode: postcodeDistrict, - itl3: { - not: null, - }, }, select: { itl3: true, diff --git a/prisma/migrations/20241213132621_make_itl_lookup_field_required/migration.sql b/prisma/migrations/20241213132621_make_itl_lookup_field_required/migration.sql new file mode 100644 index 0000000..ed64467 --- /dev/null +++ b/prisma/migrations/20241213132621_make_itl_lookup_field_required/migration.sql @@ -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; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index cf68a15..f2bc447 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -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")