Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
flyway-play
Search
Toshiyuki Takahashi
August 01, 2015
Programming
2
2.1k
flyway-play
Toshiyuki Takahashi
August 01, 2015
Tweet
Share
More Decks by Toshiyuki Takahashi
See All by Toshiyuki Takahashi
Purely Functional Programming with Cats Effect 3 and Scala 3 [ScalaMatsuri2022]
tototoshi
0
5.5k
scala-ojisan
tototoshi
0
120
5年ぶりにPHPを書いた話
tototoshi
0
280
Steps to master the Play source code
tototoshi
1
450
Template Engines in Scala
tototoshi
1
3.8k
Play と Scala のこれまでとこれから
tototoshi
1
2.1k
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
CSC509 Lecture 09
javiergs
PRO
0
140
RubyLSPのマルチバイト文字対応
notfounds
0
120
CSC509 Lecture 11
javiergs
PRO
0
180
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
1
110
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
4 Signs Your Business is Dying
shpigford
180
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Fireside Chat
paigeccino
34
3k
How to Ace a Technical Interview
jacobian
276
23k
Designing Experiences People Love
moore
138
23k
Practical Orchestrator
shlominoach
186
10k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Transcript
qZXBZQMBZ &BTZ%BUBCBTF.JHSBUJPOGPS1MBZ TDBMBؔ4VNNJU
%BUBCBTFNJHSBUJPOJTEJGpDVMU
%# w .VUBCMF w MJLFBHMPCBMWBSJBCMFTUBUF
%&7TBZT w l4FUVQEBUBCBTFNBOVBMMZ z w l)PXUPSFWJFXDIBOHFT z w l8IPDIBOHFEUIJTTDIFNB z
w l*GUFTUECEJGGFSTGSPNQSPE QSPEJT UIFSFBMz
%#"TBZT w l*EPO`ULOPXNVDIBCPVUBQQz w l)FZ%&7 HJWFNF"-5&3TDSJQUz
%BUBCBTFNJHSBUJPOJTEJGpDVMU
(PBM w $PPQFSBUJPOCFUXFFO%&7BOE%#" w .BOBHFEBUBCBTFDIBOHFT
'MZXBZNBEFJUFBTZ
8IBUJT'MZXBZ
'MZXBZ w 0QFOTPVSDFEBUBCBTFNJHSBUJPOUPPM w 8SJUUFOJO+BWB w ;FSPSFRVJSFEEFQFOEFODJFTPUIFSUIBO +BWB BOE+%#$ w
4VQQPSU42-CBTFE+BWBCBTFE NJHSBUJPO w 1PSUBCMF
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
1PSUBCMF w .BWFO w TCU w (SBEMF w "OU w
$PNNBOE-JOF w +BWB"1*
$PNNBOET w NJHSBUF w DMFBO w SFQBJS w JOGP w
WBMJEBUF w CBTFMJOF
42-CBTFE.JHSBUJPO create table language ( id integer primary key, name
varchar(100) not null );
+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) } }
IUUQXXXUIPVHIUXPSLTDPNSBEBSUPPMTqZXBZ ⚫"EPQU
8&# %#13&447PM +BWBͷ຺߭ʲୈճʳ 'MZXBZʹΑΔޮతͳ%#εΩʔϚཧ
8IBUJTqZXBZQMBZ
qZXBZQMBZ w 'MZXBZNPEVMFGPS1MBZ w QMBZqZXBZJTBWBJMBCMFGPS
libraryDependencies ++= Seq( "org.flywaydb" %% "flyway-play" % "2.1.0" ) play.modules.enabled
+= "org.flywaydb.play.PlayModule" CVJMETCU BQQMJDBUJPODPOG
8IZOPUQMBZFWPMVUJPOT
QMBZFWPMVUJPOT w EFQFOETPO1MBZ w JT XBT OPUDBQBCMFPGJOUFHSBUJOH XJUITPNFEBUBCBTFMJCSBSJFTUIBUEPO`U EFQFOEPOQMBZBQJEC w
JTOPUTPqFYJCMF
%JGGFSFODFGSPNQMBZFWPMVUJPOT
w 6QT%PXOT w .BSLFSDPNNFOU QMBZFWPMVUJPOT
qZXBZQMBZ w /Pb%PXOT`QBSU w 1MBJO42-
QMBZFWPMVUJPOT w TRM TRM TRM ʜ
qZXBZQMBZ w 0OFPSNPSFOVNFSJDQBSUT w 4FQBSBUFECZBEPU PSBO VOEFSTDPSF @
w 6OEFSTDPSFTBSFSFQMBDFECZEPUT BUSVOUJNF w -FBEJOH[FSPFTBSFJHOPSFEJOFBDI QBSU "WFSTJPONVTUIBWF UIFGPMMPXJOHTUSVDUVSF
qZXBZQMBZ w w w w @ BUSVOUJNF
w w w w w &YBNQMFTPGWBMJEWFSTJPO
QMBZFWPMVUJPOT TRM TRM DPOqJDUNFSHF TRM
QMBZFWPMVUJPOT
QMBZFWPMVUJPOT 7@@ʜʜTRM 7@@ʜʜ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