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
Percy12mo ago
Project ID: 3bfe0b93-74ce-47e0-a1e4-e71cf755eefd
Anonymous
AnonymousOP12mo 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
AnonymousOP12mo 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
AnonymousOP12mo ago
No description
Anonymous
AnonymousOP12mo ago
this error I an not able to debug the error
Anonymous
AnonymousOP12mo 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
Brody12mo ago
i recommend postgres so please read those docs pages
Anonymous
AnonymousOP12mo ago
ok could you also help me with sql mysql
Anonymous
AnonymousOP12mo 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
Brody12mo ago
please read the docs pages ive linked they will answer your questions
Anonymous
AnonymousOP12mo ago
well it didn't help
Anonymous
AnonymousOP12mo ago
No description
Brody
Brody12mo ago
thats a .env file, do you have it in a service variable too?
Anonymous
AnonymousOP12mo 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
Brody12mo ago
please enclose al code in triple back ticks
Anonymous
AnonymousOP12mo ago
ok
Brody
Brody12mo ago
then do that
Anonymous
AnonymousOP12mo ago
could you give me any example I didn't get what you said
Brody
Brody12mo ago
please read the service variables docs guide https://docs.railway.app/guides/variables#autocomplete-dropdown
Anonymous
AnonymousOP12mo 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
Brody12mo ago
correct
Anonymous
AnonymousOP12mo ago
ok
Brody
Brody12mo ago
please read this
Anonymous
AnonymousOP12mo 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
Brody12mo ago
show me a screenshot of your railway project
Anonymous
AnonymousOP12mo ago
ok
Anonymous
AnonymousOP12mo ago
No description
Brody
Brody12mo ago
that's not what I asked for a screenshot of the project, not of your database
Anonymous
AnonymousOP12mo ago
oh ok
Anonymous
AnonymousOP12mo ago
would this work
No description
Brody
Brody12mo ago
no that's still just a service
Anonymous
AnonymousOP12mo ago
oh
Brody
Brody12mo ago
full project screenshot, don't crop anything
Anonymous
AnonymousOP12mo ago
don't mind its my first time use of railway
Anonymous
AnonymousOP12mo ago
No description
Brody
Brody12mo ago
where is your app service?
Anonymous
AnonymousOP12mo 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
Brody12mo ago
how would you deploy your code to railway without a service for your code?
Anonymous
AnonymousOP12mo ago
ok my bad what are the steps for that
Brody
Brody12mo ago
have you not yet deployed your code to railway?
Anonymous
AnonymousOP12mo ago
actually what earlier tried was pushing my db to railway using prisma but I didn't know anything about service or deployment
Brody
Brody12mo ago
do you have your code on github?
Anonymous
AnonymousOP12mo ago
yess
Brody
Brody12mo ago
then deploy it from github, click the + new button
Anonymous
AnonymousOP12mo 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
Brody12mo ago
I have a feeling you haven't been reading the docs pages I've linked you?
Anonymous
AnonymousOP12mo ago
no no its not that I understood that url would be added into the service variable
Brody
Brody12mo 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
AnonymousOP12mo 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
Brody12mo ago
the 4th one
Anonymous
AnonymousOP12mo ago
ok
Brody
Brody12mo 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
AnonymousOP12mo ago
ok and the value will be the db url of db ?
Brody
Brody12mo ago
yes that's the 4th option
Anonymous
AnonymousOP12mo 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
Brody12mo ago
you want to add the 4th variable
Anonymous
AnonymousOP12mo ago
yess
Brody
Brody12mo ago
that's the only one prisma needs
Anonymous
AnonymousOP12mo ago
okk yeah it worked thanks a lot
Brody
Brody12mo ago
no problem
Want results from more Discord servers?
Add your server