Resolve "Добавить версионирование БД в проект" #33

Merged
romanov73 merged 1 commits from 5-liquibase into master 2021-03-17 14:19:52 +04:00
4 changed files with 34 additions and 1 deletions
Showing only changes of commit 16271d2a84 - Show all commits

View File

@ -52,6 +52,7 @@ dependencies {
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-hibernate5'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
compile group: 'org.postgresql', name: 'postgresql', version: '9.4.1212'
compile group: 'org.liquibase', name: 'liquibase-core', version: '4.3.1'
compile group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

View File

@ -11,3 +11,7 @@ spring.datasource.url=jdbc:postgresql://localhost:5432/repo
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driverclassName=org.postgresql.Driver
# Liquibase Settings
spring.liquibase.drop-first=false
spring.liquibase.enabled=true
spring.liquibase.change-log=classpath:db/changelog-master.xml

View File

@ -0,0 +1,21 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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 author="orion" id="20210317-140000-1">
<createTable tableName="commit">
<column name="id" type="integer">
<constraints nullable="false"/>
</column>
<column name="hash" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="date" type="timestamp">
<constraints nullable="false"/>
</column>
<column name="author" type="text"/>
<column name="message" type="text"/>
</createTable>
<addPrimaryKey columnNames="id" constraintName="pk_commit" tableName="commit"/>
</changeSet>
</databaseChangeLog>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<include file="db/changelog-20210317_140000-schema.xml"/>
</databaseChangeLog>