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
Vladimír Kriška
October 25, 2014
Programming
0
140
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
140
Design a REST API you will love to work with
ujovlado
0
780
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
500
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
390
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
160
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
110
CSS Flexbox (WebElement #35)
ujovlado
0
180
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
180
Don't underestimate CSS (WebElement #30)
ujovlado
0
610
Other Decks in Programming
See All in Programming
Patterns of Patterns
denyspoltorak
0
420
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
5.1k
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
650
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
6
2k
dchart: charts from deck markup
ajstarks
3
950
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
140
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2.1k
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
180
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
170
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
520
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
380
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
9
35k
Design in an AI World
tapps
0
120
Optimizing for Happiness
mojombo
379
70k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
96
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
110
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
200
Site-Speed That Sticks
csswizardry
13
1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
250
We Are The Robots
honzajavorek
0
130
So, you think you're a good person
axbom
PRO
1
1.9k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
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!