docker: Creating first user in Prisma studio "The column `Availability.label` does not exist in the current database."
In step 8 of the readme.md instructions, notwithstanding the workaround for #121, Prisma studio throws the following error when trying to save the fist user:
Type: PrismaClientKnownRequestError
Message:
Invalid `prisma.user.create()` invocation:
The column `Availability.label` does not exist in the current database.
Code: P2022
Query:
prisma.user.create(
{
data: {
username: "drwb",
name: "Name",
email: "email@domain.tld",
emailVerified: "2022-05-22T00:00:00.000Z",
password: "bcrypthash",
bio: null,
avatar: null,
timeZone: "Region/City",
weekStart: "Sunday",
startTime: 0,
endTime: 1440,
bufferTime: 0,
hideBranding: true,
theme: null,
createdDate: "2022-05-22T00:00:00.000Z",
eventTypes: {
},
credentials: {
},
teams: {
},
bookings: {
},
availability: {
},
selectedCalendars: {
},
completedOnboarding: false,
locale: null,
twoFactorSecret: null,
twoFactorEnabled: false,
plan: "PRO",
Schedule: {
},
webhooks: {
},
},
select: {
id: true,
username: true,
name: true,
email: true,
emailVerified: true,
password: true,
bio: true,
avatar: true,
timeZone: true,
weekStart: true,
startTime: true,
endTime: true,
bufferTime: true,
hideBranding: true,
theme: true,
createdDate: true,
eventTypes: true,
credentials: true,
teams: true,
bookings: true,
availability: true,
selectedCalendars: true,
completedOnboarding: true,
locale: true,
twoFactorSecret: true,
twoFactorEnabled: true,
plan: true,
Schedule: true,
webhooks: true,
},
}
)
When browsing the availability field, it throws the error:
Message: Error in Prisma Client request:
Invalid `prisma.availability.findMany()` invocation:
The column `Availability.label` does not exist in the current database.
Query:
prisma.availability.findMany({
where: {
AND: [
]
},
take: 100,
skip: 0,
select: {
id: true,
label: true,
user: true,
userId: true,
eventType: true,
eventTypeId: true,
days: true,
startTime: true,
endTime: true,
date: true,
}
})
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 20 (7 by maintainers)
Also seems to be happening on destinationCalendar
`Message: Error in Prisma Client request:
Invalid
prisma.destinationCalendar.findMany()invocation:The column
DestinationCalendar.bookingIddoes not exist in the current database.`It follows with “Unable to run script” error
I can confirm latest release has a mismatch between the Prisma schema and the schema in place for real. By looking at the long history of this issue, I guess the use of Primsa is a sub-optimal idea to add an user.
I suggest everyone that faces a similar issue to solve it via CLI by doing the following in the postgres machine:
If you’re here and you’re a docker newbie, basically what you need to do is to execute the following while the containers are running:
Collect the
Container IDof the postgres database and use it to get a shell inside the container:afterwards, just execute the following query, by paying attention to replace every field with your desired data:
For the ones needing a quick solution, I just used pgAdmin4 temporarily to create an user:
@PeerRich I didn’t, but since I pulled everything from scratch just yesterday, I assumed everything was up-to-date and I had no reason to update the database. If it’s not the case I can help testing it out.
Following error is thrown while trying to create first user.
Have already tried troubleshooting steps. Also removed past volume to have fresh start as advised earlier.
You may have a database volume leftover from a previous setup. Is this a fresh instance? If you need to start from scratch, you can find the database-data volume and delete it
docker volume lsdocker volume rm {name of offending volume}I am working now on getting the updated image pushed, so you can try running locally without building