Liquibase: Index.exists exception fix

Task: Fix index exists precondition exception


Instead of using index exists liquibase tag use sql to check index exists. Problem is in: liqubase library uses SYS.INDEXES but mssql has sys.indexes table.


<preConditions onFail="MARK_RAN">
  <sqlCheck expectedResult="0">SELECT count(*) FROM sys.indexes WHERE name='I_APP_ID'</sqlCheck>
<comment>Create Index I_APP_ID</comment>
<createIndex indexName="I_APP_ID" tableName="APPS" >
  <column name="APP_ID"/>
  <column name="TOPIC_ID"/>


Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here :