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

how to create a schema for defaultSchemaName

$
0
0
Hi Team,

As of now, I am creating database schema through some script in oracle.
But I want to create db schema through liquibase.  I used below changeset and I can able to create it.

<changeSet id="create-schema" author="admin"
        failOnError="false" runAlways="true">
        <preConditions onFail="MARK_RAN">
            <sqlCheck expectedResult="0">SELECT COUNT(1) FROM dba_users
                WHERE USERNAME='test_schema'</sqlCheck>
        </preConditions>

        <sql> CREATE USER test_schema IDENTIFIED BY test;</sql>
    </changeSet>


But I  want the "databasechangelog" table inside test_schema. In my Spring boot if I give 'test_schema' as default schema it is complaining error
"spring.liquibase.default-schema = test_schema"

I get an error about not being able to create the databasechangelog table, because test_schema is not present yet.

I have gone through below post

It is saying that we need to create default schema before liquibase startup.  But it is 10 years old topic.
Can you suggest whether it is still same scenario Or Is there a way to create default schema and keep databasechangelog inside test_schema.

Can anyone provide help here.

Thanks
Senthil

Viewing all articles
Browse latest Browse all 2993

Trending Articles



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