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