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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andrew Godwin
August 01, 2014
Programming
320
2
Share
Django Migrations: A Retrospective
A talk I gave at DjangoCon AU 2014.
Andrew Godwin
August 01, 2014
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
380
Django Through The Years
andrewgodwin
0
300
Writing Maintainable Software At Scale
andrewgodwin
0
510
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
400
Async, Python, and the Future
andrewgodwin
2
720
How To Break Django: With Async
andrewgodwin
1
790
Taking Django's ORM Async
andrewgodwin
0
790
The Long Road To Asynchrony
andrewgodwin
0
750
The Scientist & The Engineer
andrewgodwin
1
830
Other Decks in Programming
See All in Programming
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
250
Don't Prompt Harder, Structure Better
kitasuke
0
630
의존성 주입과 모듈화
fornewid
0
110
実践CRDT
tamadeveloper
0
400
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.7k
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
240
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
250
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
180
まかせられるPM・まかせられないPM / DevTech GUILD Meetup
yusukemukoyama
0
110
AIエージェントで業務改善してみた
taku271
0
500
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
A Soul's Torment
seathinner
6
2.6k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
170
The browser strikes back
jonoalderson
0
930
Unsuck your backbone
ammeep
672
58k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
270
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Fireside Chat
paigeccino
42
3.9k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
510
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]