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
220
Don't underestimate CSS (WebElement #30)
ujovlado
0
660
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
480
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
120
最近”作らせてる” ローカルAIアプリの話
akit37
0
220
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.5k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
340
FreeBSDでZabbixを動かす
kenkino
0
360
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5k
カツオ、ご期待ください
suneo3476
0
150
Simple Storage Service(S3) is not simple
iwatsukayura
0
220
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
320
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Making Projects Easy
brettharned
120
6.8k
Crafting Experiences
bethany
1
370
GraphQLとの向き合い方2022年版
quramy
50
15k
Site-Speed That Sticks
csswizardry
13
1.6k
Rails Girls Zürich Keynote
gr2m
96
14k
Navigating Weather and Climate Data
rabernat
0
550
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
Designing for Timeless Needs
cassininazir
1
520
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The SEO Collaboration Effect
kristinabergwall1
1
590
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!