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.4k
scala-ojisan
tototoshi
0
120
5年ぶりにPHPを書いた話
tototoshi
0
280
Steps to master the Play source code
tototoshi
1
440
Template Engines in Scala
tototoshi
1
3.8k
Play と Scala のこれまでとこれから
tototoshi
1
2k
Other Decks in Programming
See All in Programming
게임 개발하던 학생이이 세계에선 안드로이드 개발자?
pangmoo
0
110
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
10
1.4k
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
240
Integrating AI in Your Enterprise Java Applications
ivargrimstad
0
200
データマイグレーションの成功戦略~サービスリニューアルで失敗しないための実践ガイド~
tkzwtks
6
700
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
460
ROS 2のZenoh対応とZenohのROS 2対応
takasehideki
2
310
CSC509 Lecture 02
javiergs
PRO
0
160
コードレビューと私の過去と未来
jxmtst
0
280
.NET Aspireのクラウド対応検証: Azureと他環境での実践
ymd65536
1
490
[KR] Server Driven Compose With Firebase
skydoves
2
200
Cloud Adoption Framework にみる組織とクラウド導入戦略
tomokusaba
2
520
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
425
64k
Faster Mobile Websites
deanohume
304
30k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
10
1.4k
We Have a Design System, Now What?
morganepeng
49
7.2k
Debugging Ruby Performance
tmm1
73
12k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
Speed Design
sergeychernyshev
22
490
Side Projects
sachag
452
42k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
39
2.1k
Code Reviewing Like a Champion
maltzj
519
39k
Designing with Data
zakiwarfel
98
5.1k
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@@ʜʜTRM 7@@ʜʜTRM OPDPOqJDUT
5JQTVTFDBTFT
&NCFEJOZPVSBQQ w 'MZXBZIBT+BWB"1*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