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

Re : How to create conditional indexes using createIndex?

$
0
0

Hi Guys I am having similar issue and both append and computed="true" is not helping me.

DB: SQL Server

Liquibase version: 3.6.3

I have this following index in my SQL Server Database

    CREATE NONCLUSTERED INDEX XCR_ACTIVE ON dbo.CS_PA_VEH_BASE ( ETL_ACTIVE_FL ) WHERE ETL_ACTIVE_FL = 'N' ON "default";

for which `liquibase` gives out following:

 

       <createIndex indexName="XCR_ACTIVE" tableName="CS_PA_VEH_DELTA">
            <column computed="true" name="([ETL_ACTIVE_FL]='N')"/>
        </createIndex>

But when I want to execute it (also in MS SQL Server) I get the following

    > **Error:**  (14.2) 05-24-19 11:43:05 (E) (13004:15088) RUN-050304: |Session JOB_ODS_Liquibase Function call <raise_exception ( Liquibase
    > update error: 1: Unexpected error running Liquibase: Incorrect syntax
    > near '('. [Failed SQL: CREATE NONCLUSTERED INDEX XCR_ACTIVE ON
    > [dbo].[CS_PA_VEH_DELTA](([ETL_ACTIVE_FL]='N'))] ) > failed, due to
    > error <50316>: <Liquibase update error:-1: Unexpected error running
    > Liquibase: Incorrect syntax near '('. [Failed SQL: CREATE NONCLUSTERED
    > INDEX XCR_ACTIVE ON [dbo].[CS_PA_VEH_DELTA](([ETL_ACTIVE_FL]='N'))]>.

Can you please help?


Viewing all articles
Browse latest Browse all 2993

Trending Articles



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