Skip to Main Content

SQLcl

Announcement

Testing banner

Liquibase DB Migration failing for change set

User_87R1BJul 20 2022

I have spring boot app in gradle which uses Liquibase for its changesets.
when I try to run it I am facing issue while executing the below changeset:
```
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

<property name="blob_type" value="BYTEA" dbms="postgresql"/>
<property name="blob_type" value="BLOB"/>

<changeSet id="quartz-init" author="quartz">

\<createTable tableName="QRTZ\_LOCKS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="LOCK\_NAME" type="VARCHAR(40)">  
    \<constraints nullable="false"/>  
  \</column>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, LOCK\_NAME" tableName="QRTZ\_LOCKS"/>  

\<createTable tableName="QRTZ\_FIRED\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="ENTRY\_ID" type="VARCHAR(95)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="INSTANCE\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="FIRED\_TIME" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="SCHED\_TIME" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="PRIORITY" type="INTEGER">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="STATE" type="VARCHAR(16)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_NAME" type="VARCHAR(200)"/>  
  \<column name="JOB\_GROUP" type="VARCHAR(200)"/>  
  \<column name="IS\_NONCONCURRENT" type="BOOLEAN"/>  
  \<column name="REQUESTS\_RECOVERY" type="BOOLEAN"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, ENTRY\_ID" tableName="QRTZ\_FIRED\_TRIGGERS"/>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_INST\_JOB\_REQ\_RCVRY">  
  \<column name="SCHED\_NAME"/>  
  \<column name="INSTANCE\_NAME"/>  
  \<column name="REQUESTS\_RECOVERY"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_J\_G">  
  \<column name="SCHED\_NAME"/>  
  \<column name="JOB\_NAME"/>  
  \<column name="JOB\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_JG">  
  \<column name="SCHED\_NAME"/>  
  \<column name="JOB\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_T\_G">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_NAME"/>  
  \<column name="TRIGGER\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_TG">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_FIRED\_TRIGGERS" indexName="IDX\_QRTZ\_FT\_TRIG\_INST\_NAME">  
  \<column name="SCHED\_NAME"/>  
  \<column name="INSTANCE\_NAME"/>  
\</createIndex>  

\<createTable tableName="QRTZ\_CALENDARS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="CALENDAR\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="CALENDAR" type="${blob\_type}">  
    \<constraints nullable="false"/>  
  \</column>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, CALENDAR\_NAME" tableName="QRTZ\_CALENDARS"/>  

\<createTable tableName="QRTZ\_PAUSED\_TRIGGER\_GRPS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_GROUP" tableName="QRTZ\_PAUSED\_TRIGGER\_GRPS"/>  

\<createTable tableName="QRTZ\_SCHEDULER\_STATE">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="INSTANCE\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="LAST\_CHECKIN\_TIME" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="CHECKIN\_INTERVAL" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, INSTANCE\_NAME" tableName="QRTZ\_SCHEDULER\_STATE"/>  

\<createTable tableName="QRTZ\_JOB\_DETAILS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="DESCRIPTION" type="VARCHAR(250)"/>  
  \<column name="JOB\_CLASS\_NAME" type="VARCHAR(250)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="IS\_DURABLE" type="BOOLEAN">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="IS\_NONCONCURRENT" type="BOOLEAN">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="IS\_UPDATE\_DATA" type="BOOLEAN">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="REQUESTS\_RECOVERY" type="BOOLEAN">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_DATA" type="${blob\_type}"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, JOB\_NAME, JOB\_GROUP" tableName="QRTZ\_JOB\_DETAILS"/>  

\<createIndex tableName="QRTZ\_JOB\_DETAILS" indexName="IDX\_QRTZ\_J\_GRP">  
  \<column name="SCHED\_NAME"/>  
  \<column name="JOB\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_JOB\_DETAILS" indexName="IDX\_QRTZ\_J\_REQ\_RECOVERY">  
  \<column name="SCHED\_NAME"/>  
  \<column name="REQUESTS\_RECOVERY"/>  
\</createIndex>  

\<createTable tableName="QRTZ\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="JOB\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="DESCRIPTION" type="VARCHAR(250)"/>  
  \<column name="NEXT\_FIRE\_TIME" type="BIGINT"/>  
  \<column name="PREV\_FIRE\_TIME" type="BIGINT"/>  
  \<column name="PRIORITY" type="INTEGER"/>  
  \<column name="TRIGGER\_STATE" type="VARCHAR(16)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_TYPE" type="VARCHAR(8)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="START\_TIME" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="END\_TIME" type="BIGINT"/>  
  \<column name="CALENDAR\_NAME" type="VARCHAR(200)"/>  
  \<column name="MISFIRE\_INSTR" type="smallint"/>  
  \<column name="JOB\_DATA" type="${blob\_type}"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP" tableName="QRTZ\_TRIGGERS"/>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_C">  
  \<column name="SCHED\_NAME"/>  
  \<column name="CALENDAR\_NAME"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_G">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_JG">  
  \<column name="SCHED\_NAME"/>  
  \<column name="JOB\_GROUP"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_N\_G\_STATE">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_GROUP"/>  
  \<column name="TRIGGER\_STATE"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_N\_STATE">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_NAME"/>  
  \<column name="TRIGGER\_GROUP"/>  
  \<column name="TRIGGER\_STATE"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_NEXT\_FIRE\_TIME">  
  \<column name="SCHED\_NAME"/>  
  \<column name="NEXT\_FIRE\_TIME"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_NFT\_MISFIRE">  
  \<column name="SCHED\_NAME"/>  
  \<column name="MISFIRE\_INSTR"/>  
  \<column name="NEXT\_FIRE\_TIME"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_NFT\_ST">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_STATE"/>  
  \<column name="NEXT\_FIRE\_TIME"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_NFT\_ST\_MISFIRE">  
  \<column name="SCHED\_NAME"/>  
  \<column name="MISFIRE\_INSTR"/>  
  \<column name="NEXT\_FIRE\_TIME"/>  
  \<column name="TRIGGER\_STATE"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_NFT\_ST\_MISFIRE\_GRP">  
  \<column name="SCHED\_NAME"/>  
  \<column name="MISFIRE\_INSTR"/>  
  \<column name="NEXT\_FIRE\_TIME"/>  
  \<column name="TRIGGER\_GROUP"/>  
  \<column name="TRIGGER\_STATE"/>  
\</createIndex>  

\<createIndex tableName="QRTZ\_TRIGGERS" indexName="IDX\_QRTZ\_T\_STATE">  
  \<column name="SCHED\_NAME"/>  
  \<column name="TRIGGER\_STATE"/>  
\</createIndex>  

\<createTable tableName="QRTZ\_BLOB\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="BLOB\_DATA" type="${blob\_type}"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP" tableName="QRTZ\_BLOB\_TRIGGERS"/>  

\<createTable tableName="QRTZ\_SIMPROP\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="STR\_PROP\_1" type="VARCHAR(512)"/>  
  \<column name="STR\_PROP\_2" type="VARCHAR(512)"/>  
  \<column name="STR\_PROP\_3" type="VARCHAR(512)"/>  
  \<column name="INT\_PROP\_1" type="INTEGER"/>  
  \<column name="INT\_PROP\_2" type="INTEGER"/>  
  \<column name="LONG\_PROP\_1" type="BIGINT"/>  
  \<column name="LONG\_PROP\_2" type="BIGINT"/>  
  \<column name="DEC\_PROP\_1" type="NUMERIC(13,4)"/>  
  \<column name="DEC\_PROP\_2" type="NUMERIC(13,4)"/>  
  \<column name="BOOL\_PROP\_1" type="BOOLEAN"/>  
  \<column name="BOOL\_PROP\_2" type="BOOLEAN"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
        tableName="QRTZ\_SIMPROP\_TRIGGERS"/>  

\<createTable tableName="QRTZ\_CRON\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="CRON\_EXPRESSION" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TIME\_ZONE\_ID" type="VARCHAR(80)"/>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP" tableName="QRTZ\_CRON\_TRIGGERS"/>  

\<createTable tableName="QRTZ\_SIMPLE\_TRIGGERS">  
  \<column name="SCHED\_NAME" type="VARCHAR(120)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_NAME" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TRIGGER\_GROUP" type="VARCHAR(200)">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="REPEAT\_COUNT" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="REPEAT\_INTERVAL" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
  \<column name="TIMES\_TRIGGERED" type="BIGINT">  
    \<constraints nullable="false"/>  
  \</column>  
\</createTable>  
\<addPrimaryKey columnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
        tableName="QRTZ\_SIMPLE\_TRIGGERS"/>  

\<addForeignKeyConstraint baseTableName="QRTZ\_TRIGGERS"  
             constraintName="QRTZ\_TRIGGERS\_SCHED\_NAME\_FKEY"  
             baseColumnNames="SCHED\_NAME, JOB\_NAME, JOB\_GROUP"  
             referencedTableName="QRTZ\_JOB\_DETAILS"  
             referencedColumnNames="SCHED\_NAME, JOB\_NAME, JOB\_GROUP"/>  

\<addForeignKeyConstraint baseTableName="QRTZ\_SIMPLE\_TRIGGERS"  
             constraintName="QRTZ\_SIMPLE\_TRIGGERS\_SCHED\_NAME\_FKEY"  
             baseColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
             referencedTableName="QRTZ\_TRIGGERS"  
             referencedColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"/>  

\<addForeignKeyConstraint baseTableName="QRTZ\_CRON\_TRIGGERS"  
             constraintName="QRTZ\_CRON\_TRIGGERS\_SCHED\_NAME\_FKEY"  
             baseColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
             referencedTableName="QRTZ\_TRIGGERS"  
             referencedColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"/>  

\<addForeignKeyConstraint baseTableName="QRTZ\_SIMPROP\_TRIGGERS"  
             constraintName="QRTZ\_SIMPROP\_TRIGGERS\_SCHED\_NAME\_FKEY"  
             baseColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
             referencedTableName="QRTZ\_TRIGGERS"  
             referencedColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"/>  

\<addForeignKeyConstraint baseTableName="QRTZ\_BLOB\_TRIGGERS"  
             constraintName="QRTZ\_BLOB\_TRIGGERS\_SCHED\_NAME\_FKEY"  
             baseColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"  
             referencedTableName="QRTZ\_TRIGGERS"  
             referencedColumnNames="SCHED\_NAME, TRIGGER\_NAME, TRIGGER\_GROUP"/>  

</changeSet>
</databaseChangeLog>
```

I am facing below issue :
```
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/db.changelog-quartz.xml::quartz-init::quartz:
Reason: liquibase.exception.DatabaseException: ORA-00955: name is already used by an existing object
[Failed SQL: (955) CREATE TABLE SYSTEM.QRTZ_LOCKS (SCHED_NAME VARCHAR2(120) NOT NULL, LOCK_NAME VARCHAR2(40) NOT NULL)]

```

In the **changeset** I have only one table **QRTZ_LOCKS** to create.

table is getting created successfully once but not sure why it is trying to create the same table **again second time** and getting the above mentioned error.

Screenshot 2022-07-20 at 12.40.17 PM.png

FYI, I do have other **couple of changesets** but those **changesets** do not have any create table query to create table **QRTZ_LOCKS** and I am using Oracle db.

**liquibaseVersion = '4.3.5'**

Below is my project structure

Screenshot 2022-07-20 at 12.40.36 PM.png

and followings are the content of each changelog xml files.

**db.changelog-dev.xml**

```
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<changeSet id="100-1" author="author1">
<insert tableName="books">
<column name="book_name" value="harry potter1"/>
</insert>
<insert tableName="books">
<column name="book_name" value="harry potter2"/>
</insert>
</changeSet>
<changeSet id="200-1" author="author2">
<insert tableName="laptop">
<column name="laptop_name" value="windows"/>
</insert>
</changeSet>
</databaseChangeLog>
```

**db.changelog-local.xml**

```
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<changeSet id="100000000-1" author="author10">
<insert tableName="keyboard">
<column name="keyboard_name" value="logitech"/>
<column name="keyboard_version" value="v10"/>
</insert>
<insert tableName="keyboard">
<column name="keyboard_name" value="samsung"/>
<column name="keyboard_version" value="v11"/>
</insert>
<insert tableName="keyboard">
<column name="keyboard_name" value="sony"/>
<column name="keyboard_version" value="v12"/>
</insert>
</changeSet>
</databaseChangeLog>
```

**db.changelog-master.xml**

```
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<include file="db/changelog/db.changelog-schema.xml"/>
<include file="db/changelog/db.changelog-local.xml" context="local"/>
<include file="db/changelog/db.changelog-dev.xml" context="dev"/>
<include file="db/changelog/db.changelog-quartz.xml"/>

</databaseChangeLog>
```
**db.changelog-quartz.xml** - **provided in the beginning of this post**.

**db.changelog-schema.xml**

```
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<changeSet id="500000-1" author="author500">
<createTable tableName="phonemodels">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_MODELS"/>
</column>
<column name="model_name" type="VARCHAR(255)">
<constraints nullable="false" unique="true"/>
</column>
<column name="vendor_id" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
<createTable tableName="macbook">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_NATCOS"/>
</column>
<column name="macbook_name" type="VARCHAR(255)">
<constraints nullable="false" unique="true"/>
</column>
<column name="macbook_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="macbook_code" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
</column>

\</createTable>  

</changeSet>

<changeSet id="600000-1" author="author600">
<createTable tableName="int_metadata_store">
<column name="metadata_key" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="metadata_value" type="VARCHAR(4000)"/>
<column name="region" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>

<changeSet id="7000000-1" author="author700">
<createTable tableName="shedlock">
<column name="name" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_SHED_LOCK_NAME"/>
</column>
<column name="lock_until" type="timestamp(3)"/>
<column name="locked_at" type="timestamp(3)"/>
<column name="locked_by" type="VARCHAR(255)"/>
</createTable>
</changeSet>

</databaseChangeLog>
```

my properties files are below:

**application.yml**

```
server:
tomcat:
connectionTimeout: 300000
management:
endpoint:
mappings:
enabled: true
spring:
liquibase:
change-log: classpath:/db/changelog/db.changelog-master.xml
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
hikari:
minimum-idle: 5
maximumPoolSize: 20
idleTimeout: 30000
maxLifetime: 2000000
connectionTimeout: 30000
poolName: abc-pool
jpa:
hibernate:
use-new-id-generator-mappings: false
ddl-auto: none
database-platform: org.hibernate.dialect.Oracle12cDialect
quartz:
job-store-type: jdbc
jdbc:
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceId: AUTO
jobStore:
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
useProperties: false
misfireThreshold: 60000
clusterCheckinInterval: 5000
isClustered: true
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true

```

**application-dev.yml**

```
spring:
datasource:
url: jdbc:oracle:thin:@devdomain:1521/devdb
username: dev
password: devpass
liquibase:
contexts: dev
```

**application-local.yml**

```
server:
port: 8080
spring:
datasource:
url: jdbc:oracle:thin:@localhost:1521:OraDoc
username: system
password: MyPasswd123
liquibase:
contexts: local
```

**bootstrap.yml**

```
spring:
application:
name: awesome-app
```
can any one please help on this ?
Thanks

Comments
Post Details
Added on Jul 20 2022
0 comments
1,101 views