This release includes Prisma-2.0.0-beta.2, which is a big update that has many improvements, bug fixes, and new features. 🚀Prisma introduced a new relation syntax and support, which allows for complex relationships within `schema.prisma' models. RedwoodJS has improved its generators to support many model relations' use-cases. However, there are generator support limitations, which you can read about here on our community Forum. 👈
Additionally, Redwood now has a Netlify Plugin to set the DB provider during deployment. See the section below "Using the New Netlify Provider Plugin" for more information.
Changed
- 🎉Update Prisma to 2.0.0-Beta.2 (see release notes for Beta.2 and Beta.1)
- change Prisma CLI command usage to
prisma
fromprisma2
- introduces new relation syntax and support for
@relation
. See the documentation here.
- change Prisma CLI command usage to
- Improve create-redwood-app release fetching #397 @satyarohith
- Misc documentation improvements #396 #406 #393 #422 @jtoar @petukhov @nhristov @cball
- Use URLSearchParams for parsing search params #357 @mohsen1
- Update GraphQL SDL "Required Types" logic #432
Added
- Netlify plugin to handle 'provider' as an env var during Netlify build. See CRA release v0.4.0-plugin
- CLI generator tests #401
- Export useApolloClient for one-off queries #413 @RobertBroersma
- CLI command
yarn rw db introspect
#385 @Jaikant - Support table relationships in service generators #412
Fixed
- Router rendering bug #380
- Windows support for redwoodjs/redwood build scripts #363
- Windows support for create-redwood-app build scripts #410
- Redwood Router: fix route matching by enforcing type constraints #353 @olance
- Redwood Forms: fix setState warning from setError call #411 @dominicchapman
Breaking ⚠️
This breaking change only applies to Apps upgrading from previous versions.
Migration files from previous Prisma versions are incompatible with prisma-2.0.0-beta.2
. This means new local and deploy migrations will likely fail for Apps upgrading. Workaround:
- Remove the migration directory and files (delete
api/prisma/migrations
directory) and then re-create usingyarn rw db save
- If that doesn't resolve the issue, then delete the contents of the deployed DB
_Migration
table (if applicable)
Using the New Netlify Provider Plugin (optional)
These steps only apply to Apps upgrading from previous versions. New Apps already include these changes.
Redwood apps running any version can use the Netlify Provider plugin, which eliminates workarounds required to use ’SQLite’ for local development and ‘PostgreSQL’ (or other DBs) for production deployment.
If you are using PostgreSQL in production, follow the steps below.
If you need to customize your DB provider (to use MySQL, for example), refer to documentation for 'netlify-plugin-prisma-provider’. Changing the provider is as simple as adding a new environment variable in Netlify.
Add the plugin package to your App
Redwood uses yarn workspaces. Run this command to add the package to the root package.json
.
yarn add -W netlify-plugin-prisma-provider
Update Netlify deployment settings
Add the following configuration to your App’s netlify.toml
:
[[plugins]]
package = 'netlify-plugin-prisma-provider'
[plugins.inputs]
path = 'api/prisma/schema.prisma'
How to upgrade RedwoodJS packages to v0.5.0
Update your @redwoodjs/*
packages.
Four packages should be updated to v0.5.0
Root directory package.json
"@redwoodjs/core": "^0.5.0”
web/package.json
"@redwoodjs/web": "^0.5.0”
"@redwoodjs/router": "^0.5.0”
api/package.json
"@redwoodjs/api": "^0.5.0”
After updating and saving the files, install the packages from the root directory:
$ yarn install