Not able to update my User Data

I have successfully created schema and pushed db using Prisma but not able to populate the data whenever I do this it send me an error of invalid url string
62 Replies
Percy
Percy11mo ago
Project ID: 3bfe0b93-74ce-47e0-a1e4-e71cf755eefd
Anonymous
Anonymous11mo ago
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Anonymous
Anonymous11mo ago
@Answer Overflow kindly help it shows my scheam is succesfully linked with prisma n railway but is not able to create a user it gives
Anonymous
Anonymous11mo ago
No description
Anonymous
Anonymous11mo ago
this error I an not able to debug the error
Anonymous
Anonymous11mo ago
actually its a sql database n I adding the same project url to my env it clearly makes the use of env while npx prisma db push but not while creating user
Brody
Brody11mo ago
i recommend postgres so please read those docs pages
Anonymous
Anonymous11mo ago
ok could you also help me with sql mysql
Anonymous
Anonymous11mo ago
Yeah I read those n I am applying the same just wanted to ask does the use of MYSQL_URL from the db is only sufficient to connect to prisma?
Brody
Brody11mo ago
please read the docs pages ive linked they will answer your questions
Anonymous
Anonymous11mo ago
well it didn't help
Anonymous
Anonymous11mo ago
No description
Brody
Brody11mo ago
thats a .env file, do you have it in a service variable too?
Anonymous
Anonymous11mo ago
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url =env("DATABASE_URL")
relationMode = "prisma"
}

model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
entries JournalEntry[]
clerkId String @unique
email String @unique
}

model JournalEntry {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
content String @db.Text
analysis Analysis?
userId String
user User @relation(fields: [userId], references: [id])

@@index([userId]) //make unique references
}

model Analysis {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
entryId String
entry JournalEntry @relation(fields: [entryId], references: [id])
mood String
summary String @db.Text
color String
negative Boolean

@@unique([entryId])
}
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mysql"
url =env("DATABASE_URL")
relationMode = "prisma"
}

model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
entries JournalEntry[]
clerkId String @unique
email String @unique
}

model JournalEntry {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
content String @db.Text
analysis Analysis?
userId String
user User @relation(fields: [userId], references: [id])

@@index([userId]) //make unique references
}

model Analysis {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
entryId String
entry JournalEntry @relation(fields: [entryId], references: [id])
mood String
summary String @db.Text
color String
negative Boolean

@@unique([entryId])
}
no
Brody
Brody11mo ago
please enclose al code in triple back ticks
Anonymous
Anonymous11mo ago
ok
Brody
Brody11mo ago
then do that
Anonymous
Anonymous11mo ago
could you give me any example I didn't get what you said
Brody
Brody11mo ago
please read the service variables docs guide https://docs.railway.app/guides/variables#autocomplete-dropdown
Anonymous
Anonymous11mo ago
ok what I understood is that I need to add a new variable in my variables on railway with same name as in env to make its connection successful or am I going wrong
Brody
Brody11mo ago
correct
Anonymous
Anonymous11mo ago
ok
Brody
Brody11mo ago
please read this
Anonymous
Anonymous11mo ago
yeah I read but I am not able to find what variable name would suits me as not auto completion was provided as I typed in
Brody
Brody11mo ago
show me a screenshot of your railway project
Anonymous
Anonymous11mo ago
ok
Anonymous
Anonymous11mo ago
No description
Brody
Brody11mo ago
that's not what I asked for a screenshot of the project, not of your database
Anonymous
Anonymous11mo ago
oh ok
Anonymous
Anonymous11mo ago
would this work
No description
Brody
Brody11mo ago
no that's still just a service
Anonymous
Anonymous11mo ago
oh
Brody
Brody11mo ago
full project screenshot, don't crop anything
Anonymous
Anonymous11mo ago
don't mind its my first time use of railway
Anonymous
Anonymous11mo ago
No description
Brody
Brody11mo ago
where is your app service?
Anonymous
Anonymous11mo ago
How to do that earlier I guess there was no use of those or what actually I was watching a tutorial there they didn't use any such service
Brody
Brody11mo ago
how would you deploy your code to railway without a service for your code?
Anonymous
Anonymous11mo ago
ok my bad what are the steps for that
Brody
Brody11mo ago
have you not yet deployed your code to railway?
Anonymous
Anonymous11mo ago
actually what earlier tried was pushing my db to railway using prisma but I didn't know anything about service or deployment
Brody
Brody11mo ago
do you have your code on github?
Anonymous
Anonymous11mo ago
yess
Brody
Brody11mo ago
then deploy it from github, click the + new button
Anonymous
Anonymous11mo ago
ok I want to ask will this db n service how would they be connected or will the service will have its own separate db?
Brody
Brody11mo ago
I have a feeling you haven't been reading the docs pages I've linked you?
Anonymous
Anonymous11mo ago
no no its not that I understood that url would be added into the service variable
Brody
Brody11mo ago
the docs never said that though? the docs point out that you need to add your own service variables to your apps service
Anonymous
Anonymous11mo ago
yeah I am doing but in that variable what is needed to be add what not I didn't get like for example if I wanted add a variable for a mysql database which one I should choose
No description
Brody
Brody11mo ago
the 4th one
Anonymous
Anonymous11mo ago
ok
Brody
Brody11mo ago
then after you add it you can go back and change it's name to the name of the variable you use in your code
Anonymous
Anonymous11mo ago
ok and the value will be the db url of db ?
Brody
Brody11mo ago
yes that's the 4th option
Anonymous
Anonymous11mo ago
ok what if I select 1st then what will be the value for that or will selecting the 4th one will do my work
Brody
Brody11mo ago
you want to add the 4th variable
Anonymous
Anonymous11mo ago
yess
Brody
Brody11mo ago
that's the only one prisma needs
Anonymous
Anonymous11mo ago
okk yeah it worked thanks a lot
Brody
Brody11mo ago
no problem
Want results from more Discord servers?
Add your server