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
A Model for view MySQL in Prisma Schema will generating a new table with the same name once running Migrate command #6015
Comments
If there is any information missing that Prisma's developer team need, please let me know. |
The solution here would be to have views supported in the schema I think, see tracking issue #678 and upvote. |
Assigning myself to create a docs issue. |
Keeping in this cycle to confirm that the docs are fixed. |
This problem has been documented here: prisma/docs#1756 |
Hi @tomhoule , I will close the issues then. Thanks a lot. |
Bug description
When we are creating a model in Prisma Schema (using this documentation) to read from the view table in MySQL everything work fine.
But, when we running migrate command:
npx prisma migrate dev --preview-feature
, it's will create a new "data" table with the same name in MySQL Database.This is because when we running the command in the CLI, in the end, it's will create a new migration file with CREATE TABLE function instead of CREATE VIEW function.
How to reproduce
Steps to reproduce the behavior:
npx prisma migrate dev --preview-feature
in your app's root directoryapp's root directory > prisma > migrations > migration_name > migration.sql
)which is supposed to be like:
Expected behavior
Should generate a create or update View query instead create new Table query
Prisma information
I think no need for this because of my explanation above?
Environment & setup
The text was updated successfully, but these errors were encountered: