Skip to content

[BUG] - Performance Issue: All the sub relations included when add a column in the display array #635

@eng-ahmad-sameer

Description

@eng-ahmad-sameer

Description

I have these two tables:

model Location {
  id         String       @id @default(cuid())
  type       LocationType
  display    Json
  countryId  String?      @unique
  provinceId String?      @unique
  cityId     String?      @unique
  regionId   String?      @unique
  country    Country?     @relation(fields: [countryId], references: [id], onDelete: Cascade)
  province   Province?    @relation(fields: [provinceId], references: [id], onDelete: Cascade)
  city       City?        @relation(fields: [cityId], references: [id], onDelete: Cascade)
  region     Region?      @relation(fields: [regionId], references: [id], onDelete: Cascade)

  deal                Deal[]
  sellerProfile       SellerProfile[]
  brokerage           Brokerage[]
  buyerProfile        BuyerProfile[]
  sellerListing       SellerListing[]
  buyerSearchLocation BuyerProfile[]  @relation("SearchLocationsOnBuyers")

  centroid Unsupported("geometry(Point, 4326)")?
  polygon  Unsupported("geometry(MultiPolygon, 4326)")?

  @@index([type])
  @@index([centroid], type: Gist)
  @@index([polygon], type: Gist)
}

AND

model BuyerProfile {
  id                                String               @id @default(cuid())
  vwId                              Int?                 @unique
  userId                            String
  user                              User                 @relation(fields: [userId], references: [id], onDelete: Cascade, name: "BuyerProfileUser")
  latestCompletedStep               Int?
  cityId                            String?
  city                              City?                @relation(fields: [cityId], references: [id], name: "CityOnBuyers")
  provinceId                        String?
  province                          Province?            @relation(fields: [provinceId], references: [id])
  countryId                         String?
  locationId                        String?
  location                          Location?            @relation(fields: [locationId], references: [id], onDelete: SetNull)
  //...etc

  @@unique([userId])
  @@index([cityId])
  @@index([provinceId])
  @@index([countryId])
  @@index([locationId])
}

My buyer profile display options are these:

  list: {
        display: [
          "user",
          "location",
          "approvalStatus",
          "createdAt",
        ],
//...etc

When I attempt to format the location field, I notice that, in addition to including the location relation, all the relation fields within the Location table are also included, even though I do not use them, which causes a performance issue for me because I have a lot of records inside the Location table relation.

Here is what returns when I add the location field to the display array:

{
    "id": "clyyz0lbq009t5jgqvhr5ulsp",
    "type": "City",
    "display": {
        "cityName": "Burgeo",
        "countryCode": "CA",
        "countryName": "Canada",
        "provinceCode": "NL",
        "provinceName": "Newfoundland and Labrador"
    },
    "country": null,
    "province": null,
    "city": {
        "id": "clyyz0lbq009t5jgqvhr5ulsp",
        "name": "Burgeo",
        "uniqueCode": "1003028",
        "csdType": "Town",
        "provinceId": "clyyz0laq00065jgq6uz6iw3f",
        "countryId": "clyyz0lao00005jgqk0lu1f5v",
        "latitude": "47.61668000",
        "longitude": "-57.61516000"
    },
    "region": null,
    "deal": [
        {
            "id": "cm3i0vcfx00qcqzpiasoopl1a",
            "name": "name",
            "userId": "clvmkpbk0000bmjiv5ymg3w0r",
            "sellerId": "clylnjjmm00022ykh0dkk1qh0",
            "sellerListingId": null,
            "dealOpportunityId": "cm320nf3q004hes7yyspyanu8",
            "source": "Marketplace",
            "askingPrice": 3255222,
            "country": "CA",
            "province": "NL",
            "city": "Burgeo",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 234234,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 651044,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 234234,
            "downPayment": 23535,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 6,
            "realEstate": null,
            "salary": 2352355,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "yes",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 2580642.6,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": 41520.16,
            "sellerInterest": 3255.22,
            "totalDebtService": 44775.38,
            "ltv": null,
            "lenderRate": 9,
            "lenderTerm": 7,
            "DSCR": -3.94,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": 0,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": 36,
            "googleDriveFolderId": "14Q4Qehb1qCiYg7BqOmzTExDu2s7bYDbG",
            "buyerViewFolderId": "133_Uf8J4cPeNEI7cChORazYRA6vP51yP",
            "active": false,
            "createdAt": "2024-11-15T00:50:10.749Z",
            "createdById": null,
            "updatedAt": "2024-11-15T00:50:10.749Z",
            "updatedById": null,
            "deletedAt": "2024-11-20T18:39:47.476Z",
            "deletedById": "clylnjjmm00022ykh0dkk1qh0",
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        },
        {
            "id": "cm9vkh0g80029re0grh97t0jo",
            "name": "test 4",
            "userId": "clvzc4yo200088xjefmjwo520",
            "sellerId": "clvmkpbk0000bmjiv5ymg3w0r",
            "sellerListingId": null,
            "dealOpportunityId": "cm9vka2vf001vre0gnj9dmfqj",
            "source": "Marketplace",
            "askingPrice": 123123,
            "country": "CA",
            "province": "NL",
            "city": "Burgeo",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 111112,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 24624,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 111112,
            "downPayment": 234234,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 6,
            "realEstate": null,
            "salary": 234234,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "unsure",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 0,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": 0,
            "sellerInterest": 123.12,
            "totalDebtService": 123.12,
            "ltv": null,
            "lenderRate": 9,
            "lenderTerm": 7,
            "DSCR": -83.33,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": 0,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": 47,
            "googleDriveFolderId": null,
            "buyerViewFolderId": null,
            "active": false,
            "createdAt": "2025-04-24T16:18:08.648Z",
            "createdById": null,
            "updatedAt": "2025-04-24T16:18:08.648Z",
            "updatedById": null,
            "deletedAt": null,
            "deletedById": null,
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        },
        {
            "id": "cm3fxsksa0035xndee3j6jcr5",
            "name": "test 5",
            "userId": "clvmkpbk0000bmjiv5ymg3w0r",
            "sellerId": null,
            "sellerListingId": null,
            "dealOpportunityId": null,
            "source": "Manual",
            "askingPrice": 3241232,
            "country": "CA",
            "province": "NL",
            "city": "clyyz0lbq009t5jgqvhr5ulsp",
            "countryId": null,
            "provinceId": null,
            "cityId": null,
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 1234123,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 945544,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 1234123,
            "downPayment": 2353524,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 9.78,
            "realEstate": null,
            "salary": 1352355,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "yes",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 887708,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": 16347.22,
            "sellerInterest": 7706.18,
            "totalDebtService": 24053.4,
            "ltv": null,
            "lenderRate": 9.78,
            "lenderTerm": 6,
            "DSCR": -0.41,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": 0,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": 47,
            "googleDriveFolderId": "1-GKjhMb8pOEe8I9AFwSyFRlyqJUOPFag",
            "buyerViewFolderId": "1kUwWIm3n9NcaCduMALQkCVdAhu1ZAhxe",
            "active": false,
            "createdAt": "2024-11-13T13:48:30.394Z",
            "createdById": "clvmkpbk0000bmjiv5ymg3w0r",
            "updatedAt": "2025-06-22T23:45:33.009Z",
            "updatedById": "clvmkpbk0000bmjiv5ymg3w0r",
            "deletedAt": "2025-06-22T23:45:33.008Z",
            "deletedById": "clvmkpbk0000bmjiv5ymg3w0r",
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        },
        {
            "id": "cm3ykjjoq0047vq7aw6h0i7fs",
            "name": "name",
            "userId": "clvzc4yo200088xjefmjwo520",
            "sellerId": "clylnjjmm00022ykh0dkk1qh0",
            "sellerListingId": null,
            "dealOpportunityId": "cm3ykiufv003pvq7aiy1pwaf1",
            "source": "Marketplace",
            "askingPrice": 3255222,
            "country": "CA",
            "province": "NL",
            "city": "Burgeo",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 234234,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 651044,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 234234,
            "downPayment": 0,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 6,
            "realEstate": null,
            "salary": 3232222,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "unsure",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 2604177.6,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": 41898.82,
            "sellerInterest": 3255.22,
            "totalDebtService": 45154.04,
            "ltv": null,
            "lenderRate": 9,
            "lenderTerm": 7,
            "DSCR": -5.53,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": 0,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": 31,
            "googleDriveFolderId": "14DMqXoBXTA_Qadc3Oq5CQh2ThdkHVOtx",
            "buyerViewFolderId": "15MLFeOvvEOsjZ8aitx2GsbiKHcyFYHQX",
            "active": false,
            "createdAt": "2024-11-26T14:45:11.402Z",
            "createdById": null,
            "updatedAt": "2024-11-26T14:45:11.402Z",
            "updatedById": null,
            "deletedAt": "2024-12-02T13:43:23.663Z",
            "deletedById": "clylnjjmm00022ykh0dkk1qh0",
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        },
        {
            "id": "cmaq1l3d2000yret7k3q1fyux",
            "name": "Test title",
            "userId": "clvmkpbk0000bmjiv5ymg3w0r",
            "sellerId": "clvzc4yo200088xjefmjwo520",
            "sellerListingId": null,
            "dealOpportunityId": "cmaq1j5vi000iret7oirp1127",
            "source": "Marketplace",
            "askingPrice": null,
            "country": "CA",
            "province": "NL",
            "city": "Burgeo",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 1006011,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 0,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 1006011,
            "downPayment": 23432,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 6,
            "realEstate": null,
            "salary": 235233,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "unsure",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 0,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": null,
            "sellerInterest": null,
            "totalDebtService": null,
            "ltv": null,
            "lenderRate": 9,
            "lenderTerm": 7,
            "DSCR": null,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": null,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": null,
            "googleDriveFolderId": null,
            "buyerViewFolderId": null,
            "active": false,
            "createdAt": "2025-05-16T00:10:17.798Z",
            "createdById": null,
            "updatedAt": "2025-05-16T00:10:17.798Z",
            "updatedById": null,
            "deletedAt": null,
            "deletedById": null,
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        },
        {
            "id": "cmaq8iydm002bret7ivstybn6",
            "name": "test 343",
            "userId": "clvmkpbk0000bmjiv5ymg3w0r",
            "sellerId": "clylnjjmm00022ykh0dkk1qh0",
            "sellerListingId": null,
            "dealOpportunityId": "cm8gmlzhb000ere2iygss846d",
            "source": "Marketplace",
            "askingPrice": 3255222,
            "country": "CA",
            "province": "NL",
            "city": "Burgeo",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "industry": null,
            "revenue": null,
            "yearEstablished": null,
            "earnings": 234234,
            "earningsType": "EBITDA",
            "assetsValue": null,
            "sellerFinancing": 651044,
            "sellerFinancingAvailable": null,
            "reasonForSelling": null,
            "description": null,
            "additionalInformation": null,
            "loi": null,
            "normalizedEBITDA": 234234,
            "downPayment": 23432,
            "sellerFinancingTerm": 6,
            "sellerInterestRate": 6,
            "realEstate": null,
            "salary": 235233,
            "experience": null,
            "operator": null,
            "sellerRepresenative": null,
            "earnOut": "unsure",
            "leaseAgreement": null,
            "financialDocuments": null,
            "transactionLawyer": null,
            "loiDate": null,
            "dDDate": null,
            "closingDate": null,
            "financingTargetDate": null,
            "multiple": null,
            "loan": 2580745.6,
            "buyersCapitalPercentage": null,
            "sellerFinancingPercentage": null,
            "loanMonthlyPayment": 41521.82,
            "sellerInterest": 3255.22,
            "totalDebtService": 44777.04,
            "ltv": null,
            "lenderRate": 9,
            "lenderTerm": 7,
            "DSCR": 0,
            "weightedMultiple": null,
            "weightedLTV": null,
            "weightedDSCR": 0,
            "weightedSellerFinancing": null,
            "weightedExperience": null,
            "weightedBuyersCapital": null,
            "liklihoodOfLendability": 36,
            "googleDriveFolderId": null,
            "buyerViewFolderId": null,
            "active": false,
            "createdAt": "2025-05-16T03:24:35.339Z",
            "createdById": null,
            "updatedAt": "2025-05-16T03:24:35.339Z",
            "updatedById": null,
            "deletedAt": null,
            "deletedById": null,
            "originalOwnerId": null,
            "lastExtractionProcessStart": null,
            "cashFlowNormalizationBadge": false,
            "savedScenariosBadge": false
        }
    ],
    "sellerProfile": [],
    "brokerage": [],
    "buyerProfile": [
        {
            "id": "clyzs8msv0001srardh1m63li",
            "vwId": null,
            "userId": "clylnjjmm00022ykh0dkk1qh0",
            "latestCompletedStep": 0,
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "buyerTypeId": "clyyz0lzi0g6y5jgq8up04g1o",
            "buyerExpertiseId": "clyyz0m0n0g745jgqvrfzxmtx",
            "ownedBusiness": "OneToTwo",
            "isLinkedinVisible": true,
            "acquiredBusiness": "Zero",
            "lastAcquisitionIndustryId": null,
            "soldBusiness": "Zero",
            "lastSaleIndustryId": null,
            "desiredPriceMin": 100,
            "desiredPriceMax": 34242349,
            "desiredEarningsType": "SDE",
            "desiredEarningsMin": 300,
            "desiredEarningsMax": 400,
            "desiredSearchCitiesRadius": 10,
            "downPaymentBudget": 200,
            "anticipatedSalary": 20000,
            "raisingCapitalFromInvestors": false,
            "requireFinancing": true,
            "coInvestingInterest": true,
            "accreditedInvestorAcknowledgement": true,
            "shareLastName": false,
            "haveProfilePicture": true,
            "approvalStatus": "Approved",
            "createdAt": "2024-07-24T11:49:53.647Z",
            "updatedAt": "2025-08-04T23:35:35.212Z"
        }
    ],
    "sellerListing": [
        {
            "id": "clziy0xys000xmp6ix9dqvw63",
            "vwId": null,
            "userId": "clylnjjmm00022ykh0dkk1qh0",
            "title": "asfasf",
            "isPublic": true,
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "listingStatusId": "clze6rcjx0001106p9ro0xi7u",
            "yearEstablished": "3434",
            "description": "Bsafasfasfasfy.",
            "realEstateInformation": "fasfasf",
            "fullTimeEmployees": 23,
            "partTimeEmployees": 34,
            "contractors": 3,
            "reasonForSelling": "asdsdgsdg",
            "askingPrice": 3255222,
            "discloseAskingPrice": true,
            "revenue": 234234,
            "ebitda": 0,
            "sde": 0,
            "earnings": 234234,
            "earningsType": "EBITDA",
            "includeAssetsInSale": true,
            "valueOfAssets": 23424,
            "sellerFinancingAvailable": "Yes",
            "cimExtractionJobId": null,
            "approvalStatus": "Approved",
            "deletedAt": null,
            "createdAt": "2024-10-06T21:39:29.908Z",
            "updatedAt": "2025-08-06T14:01:38.040Z",
            "isDraft": false,
            "formData": null,
            "lastDraftModified": null
        },
        {
            "id": "cmaq17plh000fret7swt1edqt",
            "vwId": null,
            "userId": "clvzc4yo200088xjefmjwo520",
            "title": "Test title",
            "isPublic": true,
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "listingStatusId": "clze6rcjp0000106pzwbm3h5z",
            "yearEstablished": "2013",
            "description": "adgsdg",
            "realEstateInformation": "sdgsdg",
            "fullTimeEmployees": 12,
            "partTimeEmployees": 4,
            "contractors": 0,
            "reasonForSelling": "afadgsdg",
            "askingPrice": 1241244,
            "discloseAskingPrice": false,
            "revenue": 12444,
            "ebitda": 0,
            "sde": null,
            "earnings": 1241244,
            "earningsType": "SDE",
            "includeAssetsInSale": false,
            "valueOfAssets": 1241244,
            "sellerFinancingAvailable": "Yes",
            "cimExtractionJobId": null,
            "approvalStatus": "Approved",
            "deletedAt": null,
            "createdAt": "2025-05-15T23:59:53.429Z",
            "updatedAt": "2025-05-16T00:03:00.778Z",
            "isDraft": false,
            "formData": null,
            "lastDraftModified": null
        },
        {
            "id": "cm3vxef0n00av6apmbop5znq6",
            "vwId": null,
            "userId": "clvmkpbk0000bmjiv5ymg3w0r",
            "title": "asfaf",
            "isPublic": true,
            "countryId": "clyyz0lao00005jgqk0lu1f5v",
            "provinceId": "clyyz0laq00065jgq6uz6iw3f",
            "cityId": "clyyz0lbq009t5jgqvhr5ulsp",
            "locationId": "clyyz0lbq009t5jgqvhr5ulsp",
            "displayLocation": {
                "cityName": "Burgeo",
                "countryCode": "CA",
                "countryName": "Canada",
                "provinceCode": "NL",
                "provinceName": "Newfoundland and Labrador"
            },
            "listingStatusId": "clze6rcjp0000106pzwbm3h5z",
            "yearEstablished": "2013",
            "description": "adgsdg",
            "realEstateInformation": "adgsdg",
            "fullTimeEmployees": 3,
            "partTimeEmployees": 0,
            "contractors": 3,
            "reasonForSelling": "adgsdg",
            "askingPrice": 123123,
            "discloseAskingPrice": true,
            "revenue": 54345,
            "ebitda": 0,
            "sde": null,
            "earnings": 345346,
            "earningsType": "SDE",
            "includeAssetsInSale": true,
            "valueOfAssets": 346454,
            "sellerFinancingAvailable": "Yes",
            "cimExtractionJobId": null,
            "approvalStatus": "Approved",
            "deletedAt": null,
            "createdAt": "2025-01-24T18:21:48.551Z",
            "updatedAt": "2025-04-24T16:03:37.700Z",
            "isDraft": false,
            "formData": null,
            "lastDraftModified": null
        }
    ],
    "buyerSearchLocation": []
}

And I am only using the display column from the Location table.

"@premieroctet/next-admin": "^8.3.0",
"@premieroctet/next-admin-generator-prisma": "^1.1.0",
"@prisma/client": "^6.5.0",
"next": "^15.2.4",
"react": "^19.0.0",

Reproduction URL

N/A

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Next router

App router

Next Admin version

^8.3.0

Screenshots

![DESCRIPTION](LINK.png)

Next Admin options

Logs

Browsers

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions