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

flyway-play

 flyway-play

Toshiyuki Takahashi

August 01, 2015
Tweet

More Decks by Toshiyuki Takahashi

Other Decks in Programming

Transcript

  1. 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
  2. +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)
 }
 }
  3. qZXBZQMBZ w 0OFPSNPSFOVNFSJDQBSUT w 4FQBSBUFECZBEPU  PSBO VOEFSTDPSF @ 

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

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

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