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

Feature request : show sql statements #2

Open
dawoe opened this issue Jun 10, 2016 · 8 comments
Open

Feature request : show sql statements #2

dawoe opened this issue Jun 10, 2016 · 8 comments

Comments

@dawoe
Copy link

dawoe commented Jun 10, 2016

Would be super awesome if you could click on a migration and see which SQL statements have run as part of the migration.

@jamiepollock
Copy link
Owner

I'm not sure we have that information to hand. Currently all I believe we have to go on is the umbracoMigration table. Anything else in managed in MigrationBase classes.

Any thoughts on how we'd achieve this? :)

@dawoe
Copy link
Author

dawoe commented Jun 10, 2016

I think this would be good starting points to see how the core handles it:
https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs

https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Persistence/Migrations/MigrationBase.cs

Are you going to codegarden ? We can discuss it there ?

Dave

@jamiepollock
Copy link
Owner

@dawoe afraid I'm not. I'm using MigrationBase & MigrationRunner but we'd have to add additional code to a MigrationBase class in order to log what SQL was executed per version?

@dawoe
Copy link
Author

dawoe commented Jun 10, 2016

Will try to hack something together after codegarden

@dawoe
Copy link
Author

dawoe commented Jun 10, 2016

Strange that you had to hack something to see what is executed. Our sql statements get logged just out of the box.

@jamiepollock
Copy link
Owner

Okay, sounds like a plan. I was running against a v7.3.0 site so maybe something changed? I wasn't aware the data was being logged anywhere, where should I be looking?

Would be interesting to see what you come back with.

@dawoe
Copy link
Author

dawoe commented Jun 10, 2016

We are running 7.3.8 now and everytime we run a migration the sql statements are logged in the Umbraco log files as DEBUG line.

Maybe you have set your log4net to INFO and that's why you don't see them. Or it is added in a version after 7.3.0

@jamiepollock
Copy link
Owner

@dawoe I've started with a fresh database and ran our first run of Migrations with log4net set to DEBUG and I see what you mean about migrations logging.

I've only had a short look over the log data and I couldn't see anything that specifically ties the Migration version with the log data. I can see the migration class name but not a version at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants