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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Vladimír Kriška
October 25, 2014
Programming
0
150
Database Migrations in PHP (Posobota #66)
Vladimír Kriška
October 25, 2014
Tweet
Share
More Decks by Vladimír Kriška
See All by Vladimír Kriška
Twelve-Factor app with Docker
ujovlado
0
150
Design a REST API you will love to work with
ujovlado
0
780
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
510
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
400
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
160
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
120
CSS Flexbox (WebElement #35)
ujovlado
0
180
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
190
Don't underestimate CSS (WebElement #30)
ujovlado
0
620
Other Decks in Programming
See All in Programming
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
CSC307 Lecture 07
javiergs
PRO
1
550
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
今から始めるClaude Code超入門
448jp
8
9k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.4k
MUSUBIXとは
nahisaho
0
140
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
Git: the NoSQL Database
bkeepers
PRO
432
66k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Tell your own story through comics
letsgokoyo
1
810
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
4 Signs Your Business is Dying
shpigford
187
22k
Thoughts on Productivity
jonyablonski
74
5k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The agentic SEO stack - context over prompts
schlessera
0
640
Site-Speed That Sticks
csswizardry
13
1.1k
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!