Code Monkey home page Code Monkey logo

spring-boot-liquibase-example's Introduction

github link -> https://turgaycan2.github.io/spring-boot-liquibase-example/

Welcome to spring-boot-liquibase integration example

Spring boot, liquibase integration and h2 db integration test for PostgreSQL

Technologies

  • spring boot 1.5.1.RELEASE
  • spring-boot-starter-parent
  • spring-boot-starter-data-jpa
  • spring-boot-starter-test
  • h2 db
  • postgresql
  • liquibase

application-test.properties

spring.datasource.name=testData
spring.jmx.default-domain=jpa.sample

management.security.enabled=false
spring.jpa.hibernate.ddl-auto=none

liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
liquibase.enabled=true
liquibase.url=jdbc:h2:mem:testData;mode:PostgreSQL
liquibase.user=sa
liquibase.password=

liquibase changelog.xml

<?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="2017-02-15 12:00" author="turgay">
        <createTable tableName="city">
            <column name="id" type="long" autoIncrement="true">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="name" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
            <column name="state" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
            <column name="country" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
            <column name="map" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>

</databaseChangeLog>

spring-boot-liquibase-example's People

Contributors

turgaycan avatar

Watchers

James Cloos avatar Stelan Briyan Simonsz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.