Database Project to Drop Database before deploy?

2019-06-19 07:47发布

Is it possible to get VS to drop the destination database before a deploy?

I've tried adding a post deploy script to the project, but it always comes back with active connections.

2条回答
可以哭但决不认输i
2楼-- · 2019-06-19 08:28

You should check the Always re-create database option under publish.

DB Project -> Right Click -> Publish -> Advanced

enter image description here

查看更多
家丑人穷心不美
3楼-- · 2019-06-19 08:40

You'll need to look up the Always recreate database option in the properties of the database project -> Deploy -> Deployment configuration file -> Edit Dialog.

Another option "Drop objects that exist in the target database but not in the schema" can also be useful to you.

查看更多
登录 后发表回答