How to populate dbo.__MigrationoLog.release_version column via powershell?
PeterDaniels
Posts: 89 Bronze 3
From a previous post, I learned that we should be able to populate the release_version column of the dbo.__MigrationLog. "If deploying via PowerShell, set the $ReleaseVersion
variable to populate this column". I am using Bamboo and have a deployment package that uses a powershell script to deploy a release using the Use-DatabaseReleaseArtifact powershell cmdlet. I set the $ReleaseVersion variable as suggested, but still not seeing the column populated in the __MigrationLog table.
Tagged:
Best Answer
-
Monday Posts: 77 Silver 3Actually I am just now going down the path of using the powershell cmdlets. looks like it is set in the New-DatabaseReleaseArtifact -SqlCmdVariables switch. Example:$SqlCmdVariables = @{ReleaseVersion = $IterationNumber;}$DBConnection = New-DatabaseConnection -ServerInstance $EAMDBServer -Database $PQDBName$DBUpdate = New-DatabaseReleaseArtifact -Source $DBDeployFile -Target $DBConnection -SqlCmdVariables $SqlCmdVariablesUse-DatabaseReleaseArtifact $DBUpdate -DeployTo $DBConnection
Answers
Is there any warning message or log entry during deployment to indicate why this has not been set?
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
See this doco under: Deploying from PowerShell
https://documentation.red-gate.com/sca3/automating-database-changes/automated-deployment-with-sql-change-automation-core/sqlcmd-package-deployment
Just set the $ReleaseVersion variable, Example: