Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Database Migrations in PHP (Posobota #66)
Search
Vladimír Kriška
October 25, 2014
Programming
180
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
190
Design a REST API you will love to work with
ujovlado
0
820
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
210
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
Are APIs Still Relevant in the AI Era?
soyuka
0
230
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
280
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.9k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
580
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
230
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
0
280
自分的「カンファレンスの楽しみ方」
syumai
0
200
Family mrubyの進捗
kishima
1
120
速習iPhone Duo対応
yuukiw00w
1
510
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
190
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
130
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Code Reviewing Like a Champion
maltzj
528
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.8k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
Become a Pro
speakerdeck
PRO
31
6.3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Test your architecture with Archunit
thirion
2
2.4k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
30 Presentation Tips
portentint
PRO
1
400
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!