I have a need to email our DBA when a deployment, that utilizes EF6 code-based migrations, goes out. I am able to use the migrate.exe tool with the verbose flag, through powershell, to get the scripts but each command is truncated after 10222 characters. This usually only effects the model hash for the migrationHistory. Does anyone know of a way to generate the full sql script for EF6 migrations through Powershell
thanks T
Figured out that migrate.exe is wrapping the toolingfacade class So I created the object passing in the required variables as well as setting the verbosedelegate. The nice thing about this is that I could run the updatescript function instead if I just wanted to get the sql scripts
[Reflection.Assembly]::LoadFrom("EntityFramework.dll") | Out-Null
$con = New-Object -TypeName System.Data.Entity.Infrastructure.DbConnectionInfo -ArgumentList @("constring", "System.Data.SqlClient")
$tools = New-Object -TypeName System.Data.Entity.Migrations.Design.ToolingFacade -ArgumentList @("dbcondllname", "dbcondllname",$null,"workingdr",$null,$null,$con)
$tools.LogVerboseDelegate = {param($sql)
Write-Verbose $sql -verbose #dumps the sql to RM log
}
$tools.Update($null,$false)