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

Use Prisma's programmatic API in keystone-next reset and make keystone-next reset actually work #5152

Merged
merged 7 commits into from
Mar 18, 2021

Conversation

emmatown
Copy link
Member

Same as #5148 but for reset. This also makes the reset command actually runnable, it wasn't in the cli file before.

@vercel
Copy link

vercel bot commented Mar 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/67D6WdMJ77Ri6Rj7CbjDNnY7VF9D
✅ Preview: https://keystone-next-docs-git-prisma-migrate-reset-keystonejs.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2021

🦋 Changeset detected

Latest commit: 9651eff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@keystone-next/keystone Minor
@keystone-next/adapter-prisma-legacy Minor
@keystone-next/test-utils-legacy Patch
@keystone-next/auth Major
@keystone-next/example-auth Patch
@keystone-next/app-basic Patch
@keystone-next/example-ecommerce Patch
keystone-next-app Patch
@keystone-next/example-roles Patch
@keystone-next/example-sandbox Patch
@keystone-next/example-todo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 17, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9651eff:

Sandbox Source
@keystone-next/example-sandbox Configuration

@emmatown emmatown requested a review from timleslie March 18, 2021 00:05
);
for (const { name } of tables) {
await this.prisma.$queryRaw(`DELETE FROM "${name}";`);
throw new Error('Only "postgresql" and "sqlite" providers are supported');
Copy link
Member Author

Choose a reason for hiding this comment

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

Given we need to have a case for all the providers we'll want to support to run the tests fast enough, having a general case that we never actually use or test seems silly so I changed to an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, nice catch, this was causing our sqlite tests to be way slower than they needed to be on CI!

@vercel vercel bot temporarily deployed to Preview March 18, 2021 00:29 Inactive
@vercel vercel bot temporarily deployed to Preview March 18, 2021 00:31 Inactive
@emmatown emmatown requested a review from timleslie March 18, 2021 00:31
Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@emmatown emmatown changed the title Use Prisma migrate and make keystone-next reset actually work Use Prisma's programmatic API in keystone-next reset and make keystone-next reset actually work Mar 18, 2021
@emmatown emmatown enabled auto-merge (squash) March 18, 2021 00:35
@emmatown emmatown merged commit 00f980c into master Mar 18, 2021
@emmatown emmatown deleted the prisma-migrate-reset branch March 18, 2021 00:41
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

Successfully merging this pull request may close these issues.

2 participants