Code Monkey home page Code Monkey logo

dbdiff's Introduction

dbdiff

create mysql schema and data diff script. create markdown schema document.

mysql database 를 비교하여 스키마 및 데이터 변경사항을 sql 로 추출해주는 툴입니다.

스키마 문서를 md 파일로 생성하는 기능도 있습니다.

golang으로 작성되어 어느 OS에서도 빌드해서 사용가능합니다.

install :

usage :

  • create schema diff script
dbdiff -diff_type=schema
  -source="uid:pwd@tcp(server_ip:port)/dbname"
  -target="uid:pwd@tcp(server_ip:port)/dbname"  
  -output=output.sql
  • create data diff scirpt ( 비교할려는 테이블의 스키마가 동일해야만 정상적으로 동작합니다 )
dbdiff -diff_type=data
  -source="uid:pwd@tcp(server_ip:port)/dbname" 
  -target="uid:pwd@tcp(server_ip:port)/dbname" 
  -output=output.sql
  • create markdown document
dbdiff -diff_type=md
  -source="uid:pwd@tcp(server_ip:port)/dbname"
  -output=output.md

-- 샘플파일은 sample 폴더에 있습니다. -- output md file convert to pdf ==> ( https://github.com/jaksal/md2pdf )

  • create sql scrpit
dbdiff -diff_type=sql
  -source="uid:pwd@tcp(server_ip:port)/dbname"
  -output=output.sql
  • extra option
  -include="test_"    // include db object name containing test_  
  -exclude="test_"    // exclude db object name containing test_  
  -output="[DATE]/output.sql"   // create today date folder
  -ignore_column=update_date  // ignore column in data diff mode
  • bug

테이블 비교시 컬럼이름만 변경된 경우는 sql 만으로 알수가 없어서 해당컬럼을 drop 하고 새로 추가합니다. 이 과정에서 데이터가 유실되니 이부분 유의해주시기 바랍니다.

dbdiff's People

Contributors

bearmingo avatar jaksal avatar odysseusc 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.