Pro Yearly is on sale from $80 to $50! »

flyway-play

 flyway-play

405ad7da1defc0f6f8804e026778038f?s=128

Toshiyuki Takahashi

August 01, 2015
Tweet

Transcript

  1. qZXBZQMBZ &BTZ%BUBCBTF.JHSBUJPOGPS1MBZ TDBMBؔ੢4VNNJU

  2. %BUBCBTFNJHSBUJPOJTEJGpDVMU

  3. %# w .VUBCMF w MJLFBHMPCBMWBSJBCMFTUBUF

  4. %&7TBZT w l4FUVQEBUBCBTFNBOVBMMZ z w l)PXUPSFWJFXDIBOHFT z w l8IPDIBOHFEUIJTTDIFNB z

    w l*GUFTUECEJGGFSTGSPNQSPE QSPEJT UIFSFBMz
  5. %#"TBZT w l*EPO`ULOPXNVDIBCPVUBQQz w l)FZ%&7 HJWFNF"-5&3TDSJQUz

  6. %BUBCBTFNJHSBUJPOJTEJGpDVMU

  7. (PBM w $PPQFSBUJPOCFUXFFO%&7BOE%#" w .BOBHFEBUBCBTFDIBOHFT

  8. 'MZXBZNBEFJUFBTZ

  9. 8IBUJT'MZXBZ

  10. 'MZXBZ w 0QFOTPVSDFEBUBCBTFNJHSBUJPOUPPM w 8SJUUFOJO+BWB w ;FSPSFRVJSFEEFQFOEFODJFTPUIFSUIBO +BWB BOE+%#$ w

    4VQQPSU42-CBTFE+BWBCBTFE NJHSBUJPO w 1PSUBCMF
  11. 4VQQPSUFEEBUBCBTFT w 0SBDMF w .Z42- w 1PTUHSF42- w %# w

    ) w TPMJE%# w 42-4FSWFS w .BSJB%# w 7FSUJDB w %#[04 w )TRM w 42-"[VSF w (PPHMF$MPVE42- w "843FETIJGU w %FSCZ w 42-JUF
  12. 1PSUBCMF w .BWFO w TCU w (SBEMF w "OU w

    $PNNBOE-JOF w +BWB"1*
  13. $PNNBOET w NJHSBUF w DMFBO w SFQBJS w JOGP w

    WBMJEBUF w CBTFMJOF
  14. 42-CBTFE.JHSBUJPO create table language (
 id integer primary key,
 name

    varchar(100) not null
 );
  15. +BWBCBTFE.JHSBUJPO package db.migration.java
 
 import java.sql.Connection
 
 import org.flywaydb.core.api.migration.jdbc.JdbcMigration
 


    class V1__Create_language_table extends JdbcMigration {
 override def migrate(conn: Connection): Unit = {
 
 conn.createStatement().executeUpdate(
 """create table language (
 | id integer primary key,
 | name varchar(100) not null
 |);""".stripMargin)
 }
 }
  16. IUUQXXXUIPVHIUXPSLTDPNSBEBSUPPMTqZXBZ ⚫"EPQU

  17. 8&# %#13&447PM +BWBͷ຺߭ʲୈճʳ 'MZXBZʹΑΔޮ཰తͳ%#εΩʔϚ؅ཧ

  18. 8IBUJTqZXBZQMBZ

  19. qZXBZQMBZ w 'MZXBZNPEVMFGPS1MBZ w QMBZqZXBZJTBWBJMBCMFGPS

  20. libraryDependencies ++= Seq(
 "org.flywaydb" %% "flyway-play" % "2.1.0"
 ) play.modules.enabled

    += "org.flywaydb.play.PlayModule" CVJMETCU BQQMJDBUJPODPOG
  21. 8IZOPUQMBZFWPMVUJPOT

  22. QMBZFWPMVUJPOT w EFQFOETPO1MBZ w JT XBT OPUDBQBCMFPGJOUFHSBUJOH XJUITPNFEBUBCBTFMJCSBSJFTUIBUEPO`U EFQFOEPOQMBZBQJEC w

    JTOPUTPqFYJCMF
  23. %JGGFSFODFGSPNQMBZFWPMVUJPOT

  24. w 6QT%PXOT w .BSLFSDPNNFOU QMBZFWPMVUJPOT

  25. qZXBZQMBZ w /Pb%PXOT`QBSU w 1MBJO42-

  26. QMBZFWPMVUJPOT w TRM TRM TRM ʜ

  27. qZXBZQMBZ w 0OFPSNPSFOVNFSJDQBSUT w 4FQBSBUFECZBEPU  PSBO VOEFSTDPSF @ 

    w 6OEFSTDPSFTBSFSFQMBDFECZEPUT BUSVOUJNF w -FBEJOH[FSPFTBSFJHOPSFEJOFBDI QBSU "WFSTJPONVTUIBWF UIFGPMMPXJOHTUSVDUVSF
  28. qZXBZQMBZ w  w  w  w @ BUSVOUJNF

     w  w  w  w  w  &YBNQMFTPGWBMJEWFSTJPO
  29. QMBZFWPMVUJPOT TRM TRM DPOqJDUNFSHF TRM

  30. QMBZFWPMVUJPOT

  31. QMBZFWPMVUJPOT 7@@ʜʜTRM 7@@ʜʜTRM 7@@ʜʜTRM OPDPOqJDUT

  32. 5JQTVTFDBTFT

  33. &NCFEJOZPVSBQQ w 'MZXBZIBT+BWB"1* w &BTZUPFNCFEJOBQQ UFTU val flyway = new

    Flyway
 flyway.setDataSource(dataSource)
 flyway.migrate()

  34. &YJTUJOHEBUBCBTFTFUVQ qZXBZCBTFMJOF%qZXBZCBTFMJOF7FSTJPO %qZXBZCBTFMJOF%FTDSJQUJPO#BTFWFSTJPO IUUQqZXBZECPSHEPDVNFOUBUJPOFYJTUJOHIUNM

  35. 'SPN$-* w 4CU .BWFO (SBEMFJOEFWFOWJSPONFOU w $-*UPPMJOQSPE

  36. XJUITMJDLDPEFHFO w QJUGBMM qZXBZQMBZEPFTO`UXPSLXJUI TMJDLDPEFHFO w qZXBZQMBZFGGFDUTPOTUBSUJOHUIF QMBZBQQ w TMJDLDPEFHFOFGGFDUTJODPNQJMFUJNF

    w 6TFTCUQMVHJOJOTUFBE
  37. XJUITMJDLDPEFHFO w IUUQTHJUIVCDPNUPUPUPTIJTCUTMJDLDPEFHFOFYBNQMF

  38. 4VNNBSZ

  39. w 'MZXBZNBLFTECNJHSBUJPOFBTZ w TJNQMF QPSUBCMFBOEQPXFSGVM w 5SZJGZPVBSFJOUSPVCMFXJUIQMBZ FWPMVUJPOT