1. Create a new database on PlanetScale
Once you create a database on PlanetScale, you will get a connection string. It will look something like this:2. Update your environment variables
Update your environment variables to use the new PlanetScale connection string:apps/database/.env
apps/app/.env.local
3. Swap out the required dependencies in @repo/database
Uninstall the existing dependencies…
Terminal
Terminal
4. Update the database connection code
Update the database connection code to use the new PlanetScale adapter:packages/database/index.ts
5. Update your Prisma schema
Update your Prisma schema to use the new database provider:packages/database/prisma/schema.prisma
6. Add a dev
script
Add a dev
script to your package.json
:
packages/database/package.json