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
160
0
Share
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
160
Design a REST API you will love to work with
ujovlado
0
790
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
520
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
410
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
180
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
130
CSS Flexbox (WebElement #35)
ujovlado
0
200
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
200
Don't underestimate CSS (WebElement #30)
ujovlado
0
630
Other Decks in Programming
See All in Programming
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
150
Firefoxにコントリビューションして得られた学び
ken7253
2
150
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
210
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
410
Programming with a DJ Controller — not vibe coding
m_seki
3
750
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
110
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
160
AIを導入する前にやるべきこと
negima
2
320
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
160
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
600
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
Agentic Elixir
whatyouhide
0
440
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
680
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
170
WENDY [Excerpt]
tessaabrams
10
37k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Un-Boring Meetings
codingconduct
0
280
How to train your dragon (web standard)
notwaldorf
97
6.6k
How to make the Groovebox
asonas
2
2.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Designing for Timeless Needs
cassininazir
0
210
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
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!