Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma Migration issue #3

Open
Tech-Soumyo opened this issue Aug 6, 2024 · 1 comment
Open

Prisma Migration issue #3

Tech-Soumyo opened this issue Aug 6, 2024 · 1 comment

Comments

@Tech-Soumyo
Copy link

we have to add the following part at wrangler.toml file using the command -->> [npx wrangler d1 create user-prisma-api]
[[d1_databases]]
binding = "DB"
database_name = "My_DB"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
migrations_dir = "prisma/migrations"

then we can use the command without any problem [npx prisma migrate dev --name init_schema]

Using this way , we don't need to change wifi or server networks

here is some screenshots

create d1 databases
update wrangler toml
after prisma migration and generateion

@sanjaysahu22
Copy link

for every route we have to connect to database because of that api is taking too much time . is there any way we can only connect to database once . (possible way can be if we can write outside route or make middleware which only runs once , but
cloudflare does not support dotenv module )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants