Skip to main content
Completed

Check if domain exists

Related products:Software Factory

Blommetje

Hi, 

Sometimes we create a domain manually. For a quick fix.

However, the 020_upgrade script does not check if the domain already exists. 

So, SF outputs something like: 

/* Create domain T_bl_claus2 */
create type T_bl_claus2 from nvarchar(250) grant references on type::T_bl_claus2 to public go

Can this be wrapped with an 'IF NOT EXISTS’’?

Does not happen often, but sometimes the deployment breaks on it, which is some work to fix.

I think something similar happened when a deployment failed. Some constraints were already dropped. However, the script stopped because it couldn't find a constraint to drop. I manually created the constraint, and the script ran fine. A check for an IF EXISTS would be nice. 

Thanks

Blommetje

Did this topic help you find an answer to your question?

7 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23
NewOpen

Mark Jongeling
Administrator
Forum|alt.badge.img+23
OpenOn the backlog

Mark Jongeling
Administrator
Forum|alt.badge.img+23
On the backlogWorking on it!

Robert Jan de Nie
Thinkwise blogger
Forum|alt.badge.img+5

@Mark Jongeling, can you make sure the definition of the user-defined datatype is the same as the one that already exists on the database?

I mean, you could have done this on the database:

create type my_number from int

while having defined the my_number domain as a varchar(10) in the Software Factory.

Having this not break at this step can lead to really weird issues down the line….


Mark Jongeling
Administrator
Forum|alt.badge.img+23
Robert Jan de Nie wrote:

@Mark Jongeling, can you make sure the definition of the user-defined datatype is the same as the one that already exists on the database?

I mean, you could have done this on the database:

create type my_number from int

while having defined the my_number domain as a varchar(10) in the Software Factory.

Having this not break at this step can lead to really weird issues down the line….

That is taken into account, we'll check the existence and also its configuration on the Database.

If your domain is int and your deployed datatype is tinyint, it will be detected.

However, it will stop the deployment with an error. The developer has to resolve this.


Mark Jongeling
Administrator
Forum|alt.badge.img+23
Working on it!Next release

Jeroen van den Belt
Administrator
Forum|alt.badge.img+9
Next releaseCompleted

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings