Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 1169

precondition is not working for schema

$
0
0
Hi,

I want to have "IF NOT EXIST" functionality for my schema creation in Oracle. I am using liquibase for ddl and spring boot application.

<changeSet author="admin" id="1">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">SELECT COUNT(1) FROM dba_users WHERE USERNAME='abc'</sqlCheck>
</preConditions>
    <sql dbms="oracle" endDelimiter=";">
        CREATE USER abc IDENTIFIED BY abc DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS TEMPORARY TABLESPACE TEMP QUOTA 5M ON system PROFILE DEFAULT
    </sql>
</changeSet>

This is not working. But without <precondition> user is created, but I need 'IF NOT EXIST' .

We are writing a micro service in spring boot so that we want to have separate schema for our micro service which will be created / initialized with in our service.

Can anyone help me here.

Thanks

Senthil


Viewing all articles
Browse latest Browse all 1169

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>