Option to generate migrations as SQL #514
theelderbeever
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Yeah, it's a nice idea. A
In terms of letting people override the generated SQL, it's a bit trickier. Piccolo adds together existing migration files to work out the current state of the database. Because all of the operations in the migration files are Python code, it's quite easy to do this. It would be harder if some of the files are .sql. |
Beta Was this translation helpful? Give feedback.
2 replies
-
This is kind of fixed in the latest version of Piccolo - there's now a preview flag so you can see which DDL statements will be run by a migration:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Throwing this out there as a possible suggestion. It would be potentially valuable to have an
--sql
option with the migration management where the output ofpiccolo migrations new --sql
is a.sql
file instead of using python code. This maybe useful in debugging and transparency into what will be run and how. I know of one other ORM that does this (Hasura) and it was nice to easily edit the migration.Beta Was this translation helpful? Give feedback.
All reactions