Database migration

When promoting our database from Test to UAT (user accessing test) getting the following error - "Error in database migration: Error applying migrations to ApplicationDbContext myPay.Common.myPayException: Error applying migrations to ApplicationDbContext —> System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database ‘master’."
The database user has all the correct permissions and I can run the migration locally on the cmd line with no problem.
The migrations are not running in the test environment because they are not need at this time so they should not run on the uat environment.

Hi Robert,

Thanks for getting in touch! The scripts that run on Tentacle are run under the user that the Tentacle service runs as. This is by default Local System.
If you require to, you can change the user that the Tentacle service runs as: https://octopus.com/docs/installation/installing-tentacles/running-tentacle-under-a-specific-user-account-for-use-in-powershell

When testing a script that will run on a Tentacle via Octopus we would always suggest using the Script Console as it will run as the Tentacle user. It will give you the best replication of during a deployment.

Please let me know what you find.
Vanessa

Thx Vanessa that did the trick!!!

Hi Robert,

Great to hear it :slight_smile:

Vanessa