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

Be able to see the DDL generated by migrations #515

Closed
dantownsend opened this issue May 17, 2022 Discussed in #514 · 4 comments
Closed

Be able to see the DDL generated by migrations #515

dantownsend opened this issue May 17, 2022 Discussed in #514 · 4 comments
Labels
enhancement New feature or request

Comments

@dantownsend
Copy link
Member

Discussed in #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.

@dantownsend dantownsend added the enhancement New feature or request label May 17, 2022
@dantownsend dantownsend added this to To do in Enhancements via automation May 17, 2022
@AliSayyah
Copy link
Member

AliSayyah commented Aug 11, 2022

Hey @dantownsend
Can I have a try on this?
This option could help me out right now.

@dantownsend
Copy link
Member Author

@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
Copy link
Member

@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

Ok, thank you.

@dantownsend
Copy link
Member Author

Fixed by #584

@dantownsend dantownsend moved this from To do to Done in Enhancements Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants