Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Django Migrations: A Retrospective
Andrew Godwin
August 01, 2014
Programming
2
250
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
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
88
Async, Python, and the Future
andrewgodwin
1
360
How To Break Django: With Async
andrewgodwin
1
290
Taking Django's ORM Async
andrewgodwin
0
340
The Long Road To Asynchrony
andrewgodwin
0
380
The Scientist & The Engineer
andrewgodwin
1
370
Pioneering Real-Time
andrewgodwin
0
150
Just Add Await: Retrofitting Async Into Django
andrewgodwin
2
1.1k
Terrain, Art, Python and LiDAR
andrewgodwin
1
230
Other Decks in Programming
See All in Programming
Node.js 最新動向 TFCon 2022
yosuke_furukawa
PRO
6
2.7k
Micro Frontends with Module Federation: Beyond the Basics @jax2022
manfredsteyer
PRO
1
280
2022 FrontEnd Training
mixi_engineers
1
280
UI State Modeling 어떤게 좋을까?
laco2951
1
220
Jakarta EE 10 is Coming Your Way
ivargrimstad
0
2.2k
読みやすいコードを書こう
yutorin
0
390
Git Rebase
bkuhlmann
7
1k
書籍『良いコード/悪いコードで学ぶ設計入門』でエンジニアリングの当たり前を変える
minodriven
3
1.1k
Android Architecture Design With Koin
agiuliani
0
230
Kueue入門/Kueue Introduction
bells17
0
510
heyにおけるSREの大切さ~マルチプロダクト運用の「楽しさ」と「難しさ」および今後の展望~
fufuhu
3
1.6k
C言語でメモリ管理を考えた話
hkawai
0
190
Featured
See All Featured
Robots, Beer and Maslow
schacon
152
7.1k
Web development in the modern age
philhawksworth
197
9.3k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
100
5.9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
11
4.6k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
Practical Orchestrator
shlominoach
178
8.6k
Building a Scalable Design System with Sketch
lauravandoore
447
30k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Happy Clients
brianwarren
89
5.5k
Streamline your AJAX requests with AmplifyJS and jQuery
dougneiner
125
8.5k
Done Done
chrislema
174
14k
Code Reviewing Like a Champion
maltzj
506
37k
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 andrewgodwin@eventbrite.com