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
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
3
1.2k
subpath importsで始めるモック生活
10tera
0
340
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
7
1.8k
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
350
イベント駆動で成長して委員会
happymana
1
340
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
6
1.7k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
120
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
120
Vapor Revolution
kazupon
2
860
rails new flags - `rails new` のフラグから Rails を構成するコンポーネントの変遷をザックリ眺める
snaka
0
1.8k
デザインパターンで理解するLLMエージェントの作り方 / How to develop an LLM agent using agentic design patterns
rkaga
9
1.5k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
260
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Typedesign – Prime Four
hannesfritz
40
2.4k
It's Worth the Effort
3n
183
27k
GitHub's CSS Performance
jonrohan
1030
460k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The Invisible Side of Design
smashingmag
298
50k
Building an army of robots
kneath
302
43k
The Pragmatic Product Professional
lauravandoore
31
6.3k
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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