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
Django Migrations: A Retrospective
Search
Andrew Godwin
August 01, 2014
Programming
2
310
Django Migrations: A Retrospective
A talk I gave at DjangoCon AU 2014.
Andrew Godwin
August 01, 2014
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
330
Django Through The Years
andrewgodwin
0
220
Writing Maintainable Software At Scale
andrewgodwin
0
460
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
370
Async, Python, and the Future
andrewgodwin
2
680
How To Break Django: With Async
andrewgodwin
1
740
Taking Django's ORM Async
andrewgodwin
0
740
The Long Road To Asynchrony
andrewgodwin
0
680
The Scientist & The Engineer
andrewgodwin
1
780
Other Decks in Programming
See All in Programming
Swift Concurrency - 状態監視の罠
objectiveaudio
2
520
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
5k
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.7k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
390
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
2
500
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
240
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
Flutterで分数(Fraction)を表示する方法
koukimiura
0
130
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
110
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
160
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
870
What's in a price? How to price your products and services
michaelherold
246
12k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
We Have a Design System, Now What?
morganepeng
53
7.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
A designer walks into a library…
pauljervisheath
209
24k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Designing for humans not robots
tammielis
254
26k
Speed Design
sergeychernyshev
32
1.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3k
Rails Girls Zürich Keynote
gr2m
95
14k
Transcript
Andrew Godwin @andrewgodwin migrations: a retrospective
Andrew Godwin Author of South migrations library Hi, I'm Author
of 1.7 Django migrations I like my tea iced, and my schemas explicit
Django/Python backend I work for Discovery? Mobile? Storage? UI? On-site?
...auditing? We have it all. We're hiring!
Migrations They're pretty good.
South ...it was good for its time
The Initial Plan Django Schema backend ORM Hooks South 2
Migration handling User interface
The Revised Plan Django Schema backend ORM Hooks South 2
Migration handling User interface Backport for 1.4 - 1.6
The Revised Revised Plan Django Schema backend ORM Hooks Migration
handling User interface
Logically Separate SchemaEditor Schema Migrations field.deconstruct() ModelOptions.apps Operations Loader /
Graph Executor Autodetector Optimiser State
makemigrations field.deconstruct() Loader / Graph Autodetector Optimiser State Writer 1
2 State 3 5 4
migrate SchemaEditor ModelOptions.apps Operations Loader / Graph Executor State 1
2 Recorder 3
Moving South into Django instead, "Adding migrations to Django"
A New Format More concise Declarative Introspectable
Migration actions Frozen ORM
None
In-memory running Creates models from migration sets Autodetector diffs created
from on-disk Used to feed SchemaEditor / ORM
But what went wrong?
Swappable Models
Your migration dependencies myapp/0001 myapp/0002 otherapp/0001 auth/0001 contenttypes/0001
myapp/0001 myapp/0002 otherapp/0001 auth/0001 contenttypes/0001 thirdapp/0001 Your migration dependencies on
swappable models
what? Your migration dependencies on swappable models myapp/0001 myapp/0002 otherapp/0001
auth/0001 contenttypes/0001 thirdapp/0001 ???
what? Your migration dependencies on swappable models myapp/0001 myapp/0002 otherapp/0001
auth/0001 contenttypes/0001 thirdapp/0001 ???
Unmigrated Apps
Test persistence
Test persistence on MySQL
Random Meta options order_with_respect_to? Really?
Proxy Models
But we're close! Django 1.7, coming to a server near
you soon.
Thanks! Andrew Godwin
[email protected]