Sequentially uploading scripts in two different schemas

we have two different schemas in oracle db and now we are trying to do a sequential order of the changelogs. For ex =: we have a dependency folder where we author sql files. once the files are completed we want to deploy to the oracle db where the two schemas are present. while deploying we want to run some scripts in schema 1 and then schema2 and then again in schema 1. Is there a way to do it?

Hi @praneethvarmab,

Good question! Liquibase runs scripts in a folder (using the includeAll tag) in alpha numeric order. So, just order your includes by which folders you want to run alphanumerically, and within those folders make sure your order them alphanumerically.

Make sense?

Thank you for the Answer. Just wanted to confirm. Even if we do it alphanumerically, it will execute all the scripts in that particular folder, but what if I want to do only certain scripts and then do the rest again.

You can organize the scripts within the folder into sub-folders, that are again organized in alpha sub-folder.

Let’s say I have a folder:
FolderA
runfirst.sql
runsecond.sql
runatend.sql

I could organize it:

  • FolderA
    • FolderA1
      • runfirst.sql
      • runsecond.sql
    • FolderA2
      • runatend.sql

I could then do:
<includeAll path="…/FolderA/FolderA1/"/>
… run whatever else here
<includeAll path="…/FolderA/FolderA2/"/>

Thank you very much, this should work for the current sequence we have right now.

1 Like

@praneethvarmab ,

That’s great that it worked! Check out more examples in the Fundementals and Troubleshooting courses available on the Liquibase University.

-Ronak