P
Prisma•2w ago
Uncle

7.0 the column `(not available)` does not exist in the current database.

I'm getting an error trying to load a user since upgrading to 7.0. I've changed my imports and my client and generator. The important parts of my schema.prisma:
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}

datasource db {
provider = "postgresql"
}

model User {
id String @id @unique @default(cuid(2)) @map("id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime? @updatedAt @map("updated_at")
email String? @unique
givenName String?
familyName String?
organizationName String?
emailVerified Boolean? @map("email_verified")
employee Boolean @default(false)
admin Boolean @default(false)
archive Boolean @default(false)
googleId String?
yahooId String?
customerNotes String?
doNotRent Boolean @default(false)
alternative Boolean @default(false)
address Address[]
session Session[]
verification Verification[]
employeeDiscountCode DiscountCode[]
PropertyWithLien PropertyWithLien[]

@@unique([id, email])
@@unique([email, givenName, familyName])
@@index([id, email])
@@map("users")
}
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}

datasource db {
provider = "postgresql"
}

model User {
id String @id @unique @default(cuid(2)) @map("id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime? @updatedAt @map("updated_at")
email String? @unique
givenName String?
familyName String?
organizationName String?
emailVerified Boolean? @map("email_verified")
employee Boolean @default(false)
admin Boolean @default(false)
archive Boolean @default(false)
googleId String?
yahooId String?
customerNotes String?
doNotRent Boolean @default(false)
alternative Boolean @default(false)
address Address[]
session Session[]
verification Verification[]
employeeDiscountCode DiscountCode[]
PropertyWithLien PropertyWithLien[]

@@unique([id, email])
@@unique([email, givenName, familyName])
@@index([id, email])
@@map("users")
}
7 Replies
Prisma AI Help
Prisma AI Help•2w ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
Uncle
UncleOP•2w ago
my prisma.confing.ts:
import "dotenv/config"
import path from "node:path";
import type { PrismaConfig, } from 'prisma';
import { env } from 'prisma/config';

export default {
schema: path.join('prisma', 'schema.prisma'),
datasource: {
url: env("POSTGRES_PRISMA_URL")
},
migrations: {
seed: 'tsx prisma/seed.ts'
},
} satisfies PrismaConfig
import "dotenv/config"
import path from "node:path";
import type { PrismaConfig, } from 'prisma';
import { env } from 'prisma/config';

export default {
schema: path.join('prisma', 'schema.prisma'),
datasource: {
url: env("POSTGRES_PRISMA_URL")
},
migrations: {
seed: 'tsx prisma/seed.ts'
},
} satisfies PrismaConfig
my client:
import { POSTGRES_PRISMA_URL } from '$env/static/private';
import { PrismaClient } from '../../generated/prisma/client';
import { PrismaNeon} from '@prisma/adapter-neon'

const adapter = new PrismaNeon({
connectionString: POSTGRES_PRISMA_URL
});
export const prisma = new PrismaClient({
adapter
});
import { POSTGRES_PRISMA_URL } from '$env/static/private';
import { PrismaClient } from '../../generated/prisma/client';
import { PrismaNeon} from '@prisma/adapter-neon'

const adapter = new PrismaNeon({
connectionString: POSTGRES_PRISMA_URL
});
export const prisma = new PrismaClient({
adapter
});
Nurul
Nurul•2w ago
When exactly do you get this error? Does it happen when trying to query a user record?
Uncle
UncleOP•2w ago
Yes when I try and query a user record. Prisma studio works fine but when I load my webpage which queries a user I get the above error
Gregersen
Gregersen•2w ago
Did you migrate the schema AND generate the client? I noticed that I saw some errors with my config, using the satisfies PrismaConfig as I was using until now, but swapping to the defineConfig({}) format, seemed to fix issues. Have you tried that, to see if it fixes the issue for you?
Uncle
UncleOP•2w ago
This is also only happening on my dev machine not on vercel turns out I had conflicting env variables Thanks for the help
Gregersen
Gregersen•7d ago
Happy to help, even if my suggestion(s) werent on point 😄

Did you find this page helpful?