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

On database reset in a new project, I get a seeding configuration warning #9203

Closed
janpio opened this issue Sep 10, 2021 · 7 comments
Closed
Assignees
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma db seed CLI: prisma db seed topic: prisma migrate dev CLI: prisma migrate dev
Milestone

Comments

@janpio
Copy link
Member

janpio commented Sep 10, 2021

I have a new project. Running migrate dev detects drift, and prompts me to reset the database. If I do, I get a seed warning by default:

C:\Users\Jan\Documents\throwaway\sethRepro>npx prisma migrate dev --create-only
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": SQLite database "fancy.db" at "file:./fancy.db"

√ Drift detected: Your database schema is not in sync with your migration history.

...


We need to reset the SQLite database "fancy.db" at "file:./fancy.db".
Do you want to continue? All data will be lost. ... yes

prisma:warn To configure seeding in your project you need to add a "prisma.seed" property in your package.json with the command 
to execute it:

1. Open the package.json of your project
2. Add one of the following examples to your package.json:

TypeScript:
```
"prisma": {
  "seed": "ts-node ./prisma/seed.ts"
}
```
And install the required dependencies by running:
npm i -D ts-node typescript @types/node

JavaScript:
```
"prisma": {
  "seed": "node ./prisma/seed.js"
}
```

Bash:
```
"prisma": {
  "seed": "./prisma/seed.sh"
}
```
And run `chmod +x prisma/seed.sh` to make it executable.
More information in our documentation:
https://pris.ly/d/seeding

? Enter a name for the new migration: »

I think this is unexpected and should probably not be shown via implicit seeding.

@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma migrate dev CLI: prisma migrate dev topic: prisma db seed CLI: prisma db seed 3.x labels Sep 10, 2021
@tomhoule tomhoule added this to the 3.2.0 milestone Sep 22, 2021
@Jolg42 Jolg42 self-assigned this Sep 27, 2021
@Jolg42 Jolg42 closed this as completed in 018f4b0 Sep 29, 2021
@tomhoule
Copy link
Contributor

tomhoule commented Oct 4, 2021

I am still seeing this with 3.2.0-dev.48 (which I think includes the commit above).

@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2021

Weird, I'll try to reproduce then

@Jolg42 Jolg42 reopened this Oct 4, 2021
@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2021

@tomhoule do you have a reproduction case? I can't reproduce.

@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2021

This was a case where it happened and it doesn't anymore (legacy seed) https://github.com/prisma/prisma/pull/9484/files#diff-c266a026f47d4de125b7139076b575b33fb6dcb0207110c4a9a0f78304097b41L812-L855

@tomhoule
Copy link
Contributor

tomhoule commented Oct 4, 2021

I made a repro in this repository: https://github.com/prisma/migrate-dev-reset-message-repro

@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2021

Turns out it's also showing with migrate reset, I'll remove as well there like for dev

@Jolg42 Jolg42 closed this as completed in 6388fc8 Oct 4, 2021
@Jolg42
Copy link
Member

Jolg42 commented Oct 4, 2021

@tomhoule out in latest dev 3.2.0-dev.52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma db seed CLI: prisma db seed topic: prisma migrate dev CLI: prisma migrate dev
Projects
None yet
Development

No branches or pull requests

3 participants