For me, I have encountered an issue at this point where the “jobber-auth” database is not showing in pgadmin4 under the server. I have created the server in pgadmin with the same configuration as shown in this video. I then ran the prisma migrate command using the “migrate-prisma” target in the “project.json” file of “jobber-auth” project and the outputted logs did mention the following: “PostgreSQL database jobber-auth created at localhost:5432”. I have shared my GitHub repository below if this helps. I should also mention that I added the .env file (from the root of the project) to “.gitignore” hence you can’t see it, but I do have the exact same postgres database url for the “AUTH_DATABASE_URL” key. Would you happen to know why this is happening? I am using a Windows laptop for additional reference. Thanks
this command
nx g service/module prism
works initially the same way, but does not ask for the path where to create new files…. and creates them in the root directory of the project, so I need to manually move them to the prisma folder and make changes to the app.module …
I did the whole process but when I’m at root and run the nx Migrate-Prisma Access-Control command, it loads everything perfectly, but it doesn’t allow me to type the name of the migration and any obligations.
—————————————–//———————————————
Configuration in project.json
—————————————–//———————————————
Command result
PS C:\Development\APP Project\app> nx migrate-prisma access-control
> nx run access control:migrate-prisma
> prism migrate dev
Environment variables loaded from ..\..\.env
Prisma Schema loaded from prism\schema.prisma
Data source “db”: PostgreSQL database “access_control”, schema “public” at “localhost:5432”
question on 5:43, Isn’t it bad to keep regenerating Prisma types on every hot reload? The build process now depends on type generation, and serve depends on build, causing Prisma types to be regenerated on each hot reload.
If it’s too time-consuming, feel free to remove the dependency of type generation on the build. Just make sure to regenerate the type anytime you change the schema.
For me, I have encountered an issue at this point where the “jobber-auth” database is not showing in pgadmin4 under the server. I have created the server in pgadmin with the same configuration as shown in this video. I then ran the prisma migrate command using the “migrate-prisma” target in the “project.json” file of “jobber-auth” project and the outputted logs did mention the following: “PostgreSQL database jobber-auth created at localhost:5432”. I have shared my GitHub repository below if this helps. I should also mention that I added the .env file (from the root of the project) to “.gitignore” hence you can’t see it, but I do have the exact same postgres database url for the “AUTH_DATABASE_URL” key. Would you happen to know why this is happening? I am using a Windows laptop for additional reference. Thanks
GitHub repository: https://github.com/yusufesse/jobber/tree/main
Update: I got this working but uninstalling postgres from my windows machine
*by uninstalling postgres
Your mistake was using windows
Hi! a have a problem… when i run :
nx generate-types cnj-auth
after ask i can’t type any name or words ….
? Enter a name for the new migration: » —> here <—
i try cmd, gitbash, vscode the same problem
Win11 x64
ok when i go to apps/ and run
npx prisma migrate dev
it works fine and i can input name
this command
nx g service/module prism
works initially the same way, but does not ask for the path where to create new files…. and creates them in the root directory of the project, so I need to manually move them to the prisma folder and make changes to the app.module …
Another student pointed me to this: https://nx.dev/deprecated/as-provided-vs-derived
So make sure you provide the full path to the desired location
I did the whole process but when I’m at root and run the nx Migrate-Prisma Access-Control command, it loads everything perfectly, but it doesn’t allow me to type the name of the migration and any obligations.
—————————————–//———————————————
Configuration in project.json
},
“generate-prism”: {
“command”: “prism generation”,
“options”: {
“cwd”: “{projectRoot}”,
“input”: [“prisma/schema.prisma”]
},
“cache”: true
},
“migrate-prisma”: {
“command”: “prisma migrate dev”,
“options”: {
“cwd”: “{projectRoot}”,
“forwardAllArgs”: true
}
}
—————————————–//———————————————
Command result
PS C:\Development\APP Project\app> nx migrate-prisma access-control
> nx run access control:migrate-prisma
> prism migrate dev
Environment variables loaded from ..\..\.env
Prisma Schema loaded from prism\schema.prisma
Data source “db”: PostgreSQL database “access_control”, schema “public” at “localhost:5432”
? Enter a name for the new migration: »
Can you try running the command with –verbose flag to try and get some additional output? Also try running with the –create-only flag: https://www.prisma.io/docs/orm/prisma-migrate/workflows/development-and-production#customizing-migrations
question on 5:43, Isn’t it bad to keep regenerating Prisma types on every hot reload? The build process now depends on type generation, and serve depends on build, causing Prisma types to be regenerated on each hot reload.
If it’s too time-consuming, feel free to remove the dependency of type generation on the build. Just make sure to regenerate the type anytime you change the schema.