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

Provide easy way to reset all data in database #237

Open
schickling opened this issue Oct 17, 2019 · 6 comments
Open

Provide easy way to reset all data in database #237

schickling opened this issue Oct 17, 2019 · 6 comments
Labels

Comments

@schickling
Copy link
Member

No description provided.

@idan idan changed the title Provide easy way to reset all data Provide easy way to reset all data in database Oct 22, 2019
@idan idan added this to the Post-Beta milestone Oct 22, 2019
@schickling
Copy link
Member Author

schickling commented Nov 1, 2019

Here's an initial design proposal. It's not clear to me yet where the best location for this feature would be but this should get the ball rolling and unblock users. As part of #265 we should rethink this further.

image

Important: When clicking the button, the user should be prompted with a confirmation pop up.

@schickling schickling modified the milestones: Post-Beta, Beta Nov 1, 2019
@schickling schickling assigned sdnts and unassigned idan Nov 1, 2019
@schickling schickling added effort/low kind/feature A request for a new feature. and removed process/needs-design labels Nov 1, 2019
@schickling
Copy link
Member Author

@madebysid can you implement the functionality for this yourself or does this depend on some (missing) SDK functionality?

@sdnts
Copy link
Contributor

sdnts commented Nov 1, 2019

It is possible, I'll run a deleteMany on all models.

@janpio
Copy link
Contributor

janpio commented Nov 1, 2019

Please make sure that the need to put this somewhere more safe and hidden is tracked. Super scary, even if it needs 5 confirmations.

@sdnts sdnts modified the milestones: Beta, Post-Beta Jan 17, 2020
@sdnts sdnts modified the milestones: Post-Beta, Beta Mar 17, 2020
@matthewmueller
Copy link

matthewmueller commented Mar 17, 2020

Personally, I'd prefer if we handle this in the CLI today with a workflow like prisma truncate <models...>

Then when we go for it, we have the following UI:

image

Something to improve Soren's workflow is exporting the models from @prisma/client:

import { PrismaClient, models } from "@prisma/client"
const prisma = new PrismaClient()

for (let model of models) {
  await prisma[model].deleteMany()
}

I also think with Migrate will cover this use case better.


I'd very much prefer to leave this until post-Beta given that we have so many other fish to fry related to the databrowser.

@sdnts sdnts removed this from the Beta milestone Jun 15, 2020
@anasouardini
Copy link

anasouardini commented Aug 25, 2024

This still open!!! We need a clearAllTables method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants