Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CIフレンドリなDBドキュメント生成ツールでドキュメントの最新を維持し続ける / phpcon...

CIフレンドリなDBドキュメント生成ツールでドキュメントの最新を維持し続ける / phpconfuk_rej

【非公式】PHPカンファレンス福岡2018前夜祭リジェクトコン #phpconfuk_rej

Ken’ichiro Oyama

June 16, 2018
Tweet

More Decks by Ken’ichiro Oyama

Other Decks in Technology

Transcript

  1.  

  2. Πϯετʔϧ w)PNFCSFXͰΠϯετʔϧՄೳ   $ go get -u github.com/k1LoW/tbls $

    brew install k1LoW/tbls/tbls w(P੡ͳͷͰHPHFUͰ΋ΠϯετʔϧͰ͖·͢
  3. ྫ͑͹ϫϯϥΠφʔ w5SBWJT$*΍$JSDMF$*ͷ:".-ϑΝΠϧʹهड़ͯ͠ར༻Ͱ͖·͢   script: - DIFF=`tbls diff mysql://user:pass@hostname:3306/ dbname

    ./dbdoc` && if [ ! -z "$DIFF" ]; then echo "document does not match database." >&2 ; tbls diff mysql://user:pass@hostname:3306/dbname ./dbdoc; exit 1; fi
  4. ྫ͑͹.BLFpMF wANBLFEPDAͱANBLFUFTUEPDA   doc: ## Document database schema tbls

    doc mysql://user:pass@hostname:3306/dbname ./dbdoc testdoc: ## Test database schema document $(eval DIFF := $(shell tbls diff mysql:// user:pass@hostname:3306/dbname ./dbdoc)) @test -z "$(DIFF)" || (echo "document does not match database." && tbls diff mysql://user:pass@hostname:3306/ dbname ./dbdoc && exit 1)