The Undefined Coder
The Undefined Coder

Reputation: 45

How to avoid dropping schemas when publishing DB in VS 2019 Database project

When publishing a database from Visual Studio, there are several options to "do not drop" an object if it is not in the Source. However, it seems that there is no option to avoid dropping schemas. Do anyone know if this is possible to achieve, or do I have to manually edit the publish script?

Upvotes: 0

Views: 176

Answers (1)

Philip Kelley
Philip Kelley

Reputation: 40359

It would probably be simplest just to add the schema to the project. The script would be simple enough, we use:

CREATE SCHEMA [api] AUTHORIZATION [dbo];

(Also, I wish I'd seen this question much earlier, hopefully this isn't too late to help someone.)

Upvotes: 1

Related Questions