Closed JohnGoldInc closed 3 years ago
@JohnGoldInc Thanks for reporting. What happens if you move the CREATE SCHEMA
to a separate file? I'm fairly certain this works since we've been doing this for ages.
@jmezach I had tried it as a separate file previously.
Found my solution though, just had to remove the IF SCHEMA_ID(N'Security') IS NULL
stuff and put CREATE SCHEMA [Security];
in a separate file
@jmezach getting out of the habit of putting IF NOT EXISTS's around creates is the major trick to this way of doing things it seems :)
@JohnGoldInc Think of the .dacpac scripts as describing the desired state, so just always use CREATE.
The DacFX / sqlpackage magic juice takes care of bringing the target database to the desired state without data loss.
errors on build with:
[Security].[CategoryType] has an unresolved reference to SqlSchema [Security]. Northwind.Sql