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
Database Migrations in PHP (Posobota #66)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Vladimír Kriška
October 25, 2014
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Database Migrations in PHP (Posobota #66)
Vladimír Kriška
October 25, 2014
More Decks by Vladimír Kriška
See All by Vladimír Kriška
Twelve-Factor app with Docker
ujovlado
0
180
Design a REST API you will love to work with
ujovlado
0
810
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
530
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
440
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
200
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
150
CSS Flexbox (WebElement #35)
ujovlado
0
200
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
210
Don't underestimate CSS (WebElement #30)
ujovlado
0
650
Other Decks in Programming
See All in Programming
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
250
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
500
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
130
AIと壁打ちしながら進めるコスト管理
fufuhu
1
1.4k
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.8k
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
220
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
170
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
710
VibeCodingからAgenticWorkflowへ
starfish719
0
730
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
350
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
200
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Done Done
chrislema
186
16k
Side Projects
sachag
455
43k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
480
Thoughts on Productivity
jonyablonski
76
5.3k
Code Review Best Practice
trishagee
74
20k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
470
The browser strikes back
jonoalderson
0
1.5k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
490
Transcript
Database Migrations in PHP Posobota #66 Vladimír Kriška @ujovlado
My experience • Paradox: first company I worked with was
the closest to migrations • Then it went only worse • no migrations • single file migrations • Yii framework database migrations
Pros • Exact version of schema with creation and application
date • CLI interface (automation) • Easy rollback, going through history
Cons • Need to regenerate/change model
Other options/ideas • Generate migrations directly from model (no SQL
writing) • With each change create DB dump with file per table, than version in Git
Other tools • Phinx • Sqitch (Perl) • Doctrine, Phalcon,
Propel, CakePHP • and many others …
Migrations in Yii • Two main commands • yiic migrate
up • yiic migrate down • And also: history, new, to, mark
Example • let’s do some shit …
Tips/tricks • DB schema has to be versioned - no
matter how • If you don’t know how to do it, choose solution from some framework • Don’t write own tool for migrations • Start with migrations ASAP
• Always write down migrations • Try to avoid shortcut
methods (they disallow c&p from migration) • Don’t mix schema and data migrations • Write short migrations • Don’t change applied migrations
THE END Thanks!