Failing database build
BenNeuwirth
Posts: 3 New member
Our Azure Devops pipeline uses Invoke-DatabaseBuild to create build our database before we release.
We're getting an error on one of databases:
This schema was create yrs ago and only exists once in the database.
No recent commits touch that schema at all
I don’t understand how a guid build database can already have an existing schema if it’s being created on the fly.
Any help would be appreciated
We're getting an error on one of databases:
WARNING: The error 'There is already an object named 'GL' in the database.
WARNING: CREATE SCHEMA failed due to previous errors.' occurred when executing the following SQL:
WARNING: CREATE SCHEMA [GL]
WARNING: AUTHORIZATION [dbo]
This schema was create yrs ago and only exists once in the database.
No recent commits touch that schema at all
I don’t understand how a guid build database can already have an existing schema if it’s being created on the fly.
Any help would be appreciated
Tagged:
Best Answer
-
Kendra_Little Posts: 139 Gold 3Hi Ben,Some first places I would look...Is it possible some code was accidentally deployed to the model database and created that schema there? If you're using a dynamically named database to build (you're not specifying the name and it automatically creates one with a guid-like name), when SQL Server creates the db it will automatically have what's in model before any code is deployed and it could cause this issue.If that's not it, could some code have been added to a pre-deployment script that is doing this?Hope this helps,Kendra
Answers
We did have some pre deployment scripts in this commit that (although it didn't affect this schema) I can review.
That might be a good lead.
Thanks
It worked. I removed the pre-deployment script and my build succeeded.
Still not sure why it would be the source of the issue because the script didn't touch that schema. We must be doing something else wrong...
Good for now.
Thanks!