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
Search
trumpi
September 08, 2012
Programming
2
150
Database Migrations
A synopsis of the different database migration methods that exist - both good and bad!
trumpi
September 08, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
780
Serena MCPのすすめ
wadakatu
4
800
TokyoR#119 bignners session2 Visualization
kotatyamtema
0
130
Repenser les filtres API Platform: une nouvelle syntaxe
vinceamstoutz
2
150
Reduxモダナイズ 〜コードのモダン化を通して、将来のライブラリ移行に備える〜
pvcresin
2
630
プログラマのための作曲入門
cheebow
0
500
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
780
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
110
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
380
2025年版 サーバーレス Web アプリケーションの作り方
hayatow
23
25k
CSC509 Lecture 03
javiergs
PRO
0
320
猫と暮らすネットワークカメラ生活🐈 ~Vision frameworkでペットを愛でよう~ / iOSDC Japan 2025
yutailang0119
0
210
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Making Projects Easy
brettharned
118
6.4k
Designing for Performance
lara
610
69k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
YesSQL, Process and Tooling at Scale
rocio
173
14k
4 Signs Your Business is Dying
shpigford
185
22k
Navigating Team Friction
lara
189
15k
A Tale of Four Properties
chriscoyier
160
23k
A Modern Web Designer's Workflow
chriscoyier
697
190k
We Have a Design System, Now What?
morganepeng
53
7.8k
Transcript
Bringing the database schema up to date with a new
code base
Backup the database in a dev environment – restore it
in production The problem: Production data is completely overwritten by Dev data
Use a database schema synchronisation tool The problem: Can still
be destructive
Script every change IF NOT EXISTS (…) Becomes a problem
if a script undoes the changes of a previous script
Write scripts that check a version table Add a row
to the version table if the script is successful The best approach, but scripts are difficult to write Transactions are tricky Rolling back is difficult
Library that provides an API for database changes Transactions and
the version table is handled behind the scenes Provides forward and backward migration Libraries available in .NET • FluentMigrator • Migrator.NET
None
Always back up the database before a migration Rather restore
the database than run the “Down” migration
…but don’t be “that guy”.