Base solution for your next web application
Open Closed

Log all the migration #3226


User avatar
0
[email protected] created

Hi Guys,

Any idea how can i enable logging of all the SQL when i am running migration .

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If I understand correctly, you can use -verbose flag with Update-Database command to see runned migration's SQL.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    [email protected] created

    Thanks for the reply i need to log all the SQL statments into a log when the Migrator exe is run on production environment so as to check if what all things got fired and to cross check also if everything went well.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Migrator tool does not support this by default. I'm not %100 sure but as far as I remember Entity Framework supports this with some interception but I don't know how to do it. Maybe you can find a solution on the web for this.

    In Migrator tool, we basically call , DbContext.Database.Migrate();

    Thanks.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    [email protected] created

    Thanks for the input.

    I am able to log all the DML statements but not the DDL statements.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)