Be able to see the DDL generated by migrations
Discussed in https://github.com/piccolo-orm/piccolo/discussions/514
Originally posted by theelderbeever May 16, 2022
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 of piccolo 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.
Hey @dantownsend Can I have a try on this? This option could help me out right now.
@AliSayyah Yes, that would be great.
We need to modify MigrationManager somehow so instead of running queries, it prints out the SQL.
https://github.com/piccolo-orm/piccolo/blob/master/piccolo/apps/migrations/auto/migration_manager.py
@AliSayyah Yes, that would be great.
We need to modify
MigrationManagersomehow so instead of running queries, it prints out the SQL.https://github.com/piccolo-orm/piccolo/blob/master/piccolo/apps/migrations/auto/migration_manager.py
Ok, thank you.
Fixed by https://github.com/piccolo-orm/piccolo/pull/584