Lafox.Net lafox.net
Spring Boot: Quartz.

Spring Boot: Quartz.

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

    <includeAll path="changelog/changes"/>

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

    <changeSet id="users table" author="oleh.tsymaienko">

        <createTable tableName="users">
            <column name="id" autoIncrement="true" type="BIGINT">
                <constraints nullable="false" primaryKey="true" primaryKeyName="pk_users"/>
            </column>
            <column name="name" type="varchar(255)"/>
            <column name="created" type="timestamp"/>
            <column name="updated" type="timestamp"/>
        </createTable>

        <createIndex indexName="idx_pageviews_name" tableName="users">
            <column name="name"/>
        </createIndex>

    </changeSet>

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

    <changeSet id="users table" author="oleh.tsymaienko">

        <createTable tableName="users">
            <column name="id" autoIncrement="true" type="BIGINT">
                <constraints nullable="false" primaryKey="true" primaryKeyName="pk_users"/>
            </column>
            <column name="name" type="varchar(255)"/>
            <column name="created" type="timestamp"/>
            <column name="updated" type="timestamp"/>
        </createTable>

        <createIndex indexName="idx_pageviews_name" tableName="users">
            <column name="name"/>
        </createIndex>

    </changeSet>

</databaseChangeLog>
### datasource settings ###
spring.datasource.url=jdbc:postgresql://localhost:5432/DEMO_DATABASE
spring.datasource.username=DEMO_USERNAME
spring.datasource.password=DEMO_PASSWORD
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.properties.hibernate.types.print.banner=false
spring.jpa.open-in-view=true

### liquibase settings ###
spring.liquibase.change-log=classpath:changelog/db.changelog-master.xml
logging.level.liquibase.hub=ERROR
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>net.lafox.bluecat</groupId>
    <artifactId>spring-boot-liquibase-demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-boot-liquibase-demo</name>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${project.parent.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>