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

drizzle-kit generate options for --from-schema-datamodel and --to-schema-datamodel? #559

Open
karlhorky opened this issue Sep 5, 2024 · 0 comments

Comments

@karlhorky
Copy link

karlhorky commented Sep 5, 2024

Similar to prisma migrate diff, allow for passing schema file paths as the "from" and "to" when generating migrations:

Options Description
--from-schema-datamodel Path to a Prisma schema file, uses the data model for the diff
--to-schema-datamodel Path to a Prisma schema file, uses the data model for the diff

This would allow for richer migrations generation workflows, as in the prisma migrate workflows docs.

My own use case is not mentioned on that link:

I am trying to generate a file with SQL queries containing the current PostgreSQL schema diff for a PR, based on our own homegrown SQL-in-JS schemas.

With the --from-schema-datamodel and --to-schema-datamodel options (or similar options with other names), I imagine I could run drizzle-kit generate as follows in CI to autogenerate the migrations:

drizzle-kit generate --from-schema-datamodel main-schema.ts --to-schema-datamodel feature-schema.ts
# then commit to Git in the CI step
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

No branches or pull requests

1 participant