사용자 도구

사이트 도구


java:database:migration:liquibase

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
java:database:migration:liquibase [2020/07/16 14:51]
kwon37xi [Gradle]
java:database:migration:liquibase [2022/04/14 12:34] (현재)
kwon37xi
줄 34: 줄 34:
     activities {     activities {
         main {         main {
-            changeLogFile 'src/migration/db.changelog-main.xml'+            changeLogFile 'src/migration/changelog-main.xml'
             url "jdbc:url..."             url "jdbc:url..."
             username "username"             username "username"
줄 42: 줄 42:
 } }
 </code> </code>
- +===== ChangeLog 관리 ===== 
-===== Change Types =====+  * main changelog 관리 XML을 만들고, 거기서 각각 단일 changeset 을 가지는 다른 xml 들을 include 하는 형태로 관리하는 것이 좋다. 
 +  * 하나의 chagelog 파일은 하나의 changeset 만 가지는 것이 좋다. 
 +  * ''changelog-main.xml''<code 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.8.xsd">   
 +  <include  file="com/example/db/changelog/db.changelog-1.0.xml"/>    
 +  <include  file="com/example/db/changelog/db.changelog-1.1.xml"/>    
 +  <include  file="com/example/db/changelog/db.changelog-2.0.xml"/>    
 +</databaseChangeLog>  
 +</code> 
 +  * ''changelog-1.0.xml'' ... <code 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.8.xsd">    
 +  <changeSet  author="authorName"  id="changelog-1.0">   
 +    <createTable  tableName="TablesAndTables">   
 +      <column  name="COLUMN1"  type="TEXT">   
 +        <constraints  nullable="true"  primaryKey="false"  unique="false"/>   
 +      </column>   
 +    </createTable>   
 +  </changeSet>   
 +</databaseChangeLog>  
 +</code> 
 +===== Change Set Types =====
 ==== sql ==== ==== sql ====
   * https://docs.liquibase.com/change-types/community/sql.html   * https://docs.liquibase.com/change-types/community/sql.html
줄 67: 줄 97:
   * [[https://dzone.com/articles/managing-your-database-with-liquibase-and-gradle|Managing Your Database With Liquibase and Gradle - DZone Database]]   * [[https://dzone.com/articles/managing-your-database-with-liquibase-and-gradle|Managing Your Database With Liquibase and Gradle - DZone Database]]
   * [[https://joont92.github.io/etc/liquibase/|liquibase | 기록은 기억의 연장선]]   * [[https://joont92.github.io/etc/liquibase/|liquibase | 기록은 기억의 연장선]]
 +  * [[https://www.baeldung.com/liquibase-vs-flyway|Liquibase vs Flyway | Baeldung]]
java/database/migration/liquibase.1594878684.txt.gz · 마지막으로 수정됨: 2020/07/16 14:51 저자 kwon37xi