-
Notifications
You must be signed in to change notification settings - Fork 970
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
[breaking] upgrade Prisma v2.16.0 and replace rw db
commands with rw prisma
#1720
Conversation
OK, this is most likely going to require upgrading commands at the same time we upgrade Prisma version. I'll coordinate with @peterp directly. |
@thedavidprice I've now added the pass through command and the deprecation notices; you can test this by:
pwd
~/gh/redwoodjs/redwood/packages/cli
__REDWOOD__CONFIG_PATH=../../__fixtures__/example-todo-main yarn node dist/index.js db up
Deprecation notice
The rw db up command is now deprecated, please try rw prisma up instead.
Migrations are now available via the rw prisma migrate command.
Please view the migration docs The copy probably needs some work, but it seems to be working nicely. :) |
rw db
commands with rw prisma
@@ -1,24 +1,15 @@ | |||
// helper used in Dev and Build commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db generate
had specific logic for use with Build and Dev commands. I converted to a helper and moved to commands/prisma/generate.js
. Perhaps best to move into prisma.js
? Suggestions otherwise?
@peterp I have all the commands working now. (Some are more elegant than others.) Input and changes are 100% welcome. Problems
Questions
Improvements:
|
@peterp @cannikin I think I'm over my head regarding the failing tests. My best guess is that Prisma has changed DMMF behavior under the hood without any heads up. Here's a screenshot from the first test that fails: All roads (that I've traveled) lead back to ...
export const getSchemaDefinitions = async () => {
const schemaPath = path.join(getPaths().api.db, 'schema.prisma')
const metadata = await getDMMF({
datamodel: readFile(schemaPath.toString()),
})
return metadata
}
... So, ahem, what is the Prisma Schema DMMF? 🤔
|
@cannikin is my HERO 😍 |
…ender-p1 * 'main' of github.com:redwoodjs/redwood: Exclude --help, leave everything else. Fix yargs command. Specify node_env before running build web Prisma migrate dev handles schema path with spaces Dynamically add args as options. This is not a TS package. Move generate command into lib. check if flags exist (redwoodjs#1746) use new prisma command (redwoodjs#1745) remove dynamic provider and related copy (redwoodjs#1743) [breaking] upgrade Prisma v2.16.0 and replace `rw db` commands with `rw prisma` (redwoodjs#1720) MockProvider: Wrap children in LocationProvider Adds Facebook to list of supported Supabase OAuth providers (redwoodjs#1739) Specify types for the router package bugfix: don't pass cell children to useQuery
template/api/db/seeds.js
-->seed.js
Breaking
This upgrade introduces the new Prisma Migrate:
yarn rw db
commandsschema.prisma
Dyanmic Provider (fully deprecated)Replace
@prisma/cli
packageThis PR also replaces the package
@prisma/cli
withprisma
. See the related Prisma Release Note.Prisma Release Notes