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
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
CSC307 Lecture 02
javiergs
PRO
1
780
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
AtCoder Conference 2025
shindannin
0
1.1k
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
380
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
2026年 エンジニアリング自己学習法
yumechi
0
140
Architectural Extensions
denyspoltorak
0
290
MUSUBIXとは
nahisaho
0
140
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
AgentCoreとHuman in the Loop
har1101
5
240
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
Making the Leap to Tech Lead
cromwellryan
135
9.7k
ラッコキーワード サービス紹介資料
rakko
1
2.3M
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Google's AI Overviews - The New Search
badams
0
910
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Rails Girls Zürich Keynote
gr2m
96
14k
Scaling GitHub
holman
464
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
77
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!