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

Remove deprecated config.db.useMigrations, change keystone prisma behaviour #9090

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Apr 11, 2024

This pull request removes config.db.useMigrations, which was deprecated in #8046, but perhaps a better description of why is needed to help with updating your workflow.

I'll add a draft of that workflow here into our documentation soon.
The short of it could probably be summarised in the following text (work in progress):

# development lifecycle
$ keystone dev
  1. Keystone updates your schemas (GraphQL, Prisma, Typescript)
  2. Prisma pushes any updates to your database (unless you use --no-db-push)
  3. Go to 1, until ready

$ keystone prisma migrate dev --create-only
  4. Generate any database migrations, editing as required
   
$ keystone start --with-migrations
  5. Test your migrations
  6. If happy, continue, otherwise go back, using `keystone prisma migrate reset` as needed
   
# ...
  
# deploying
$ keystone build
 
$ keystone start --with-migrations

Any feedback is appreciated, as we move to integrate this workflow into the documentation.

References

@@ -89,7 +89,7 @@ export async function cli (cwd: string, argv: string[]) {
}

if (command === 'start') {
return start(cwd, defaultFlags(flags, { ui: true, withMigrations: false }))
return start(cwd, defaultFlags(flags, { server: true, ui: true, withMigrations: false }))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start --with-migrations --no-server might be redundant by comparison to keystone prisma migrate deploy, but, I think start --no-server being ignored is worse

})
}

export async function devMigrations (
Copy link
Member Author

@dcousens dcousens Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use keystone prisma migrate dev instead

@dcousens dcousens force-pushed the no-use-migrations branch from 951fd81 to e90447e Compare April 15, 2024 03:20
@keystonejs keystonejs deleted a comment from codesandbox-ci bot Apr 15, 2024
@dcousens dcousens merged commit e21c117 into main Apr 15, 2024
43 checks passed
@dcousens dcousens deleted the no-use-migrations branch April 15, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant