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
South New and Old
Search
Andrew Godwin
May 25, 2010
Programming
0
140
South New and Old
A talk I gave at DjangoCon Europe 2010
Andrew Godwin
May 25, 2010
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
270
Django Through The Years
andrewgodwin
0
170
Writing Maintainable Software At Scale
andrewgodwin
0
400
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
320
Async, Python, and the Future
andrewgodwin
2
620
How To Break Django: With Async
andrewgodwin
1
690
Taking Django's ORM Async
andrewgodwin
0
680
The Long Road To Asynchrony
andrewgodwin
0
600
The Scientist & The Engineer
andrewgodwin
1
710
Other Decks in Programming
See All in Programming
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
260
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
120
チームリードになって変わったこと
isaka1022
0
200
Amazon Bedrock Multi Agentsを試してきた
tm2
1
290
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
2
380
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
750
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
210
『品質』という言葉が嫌いな理由
korimu
0
160
color-scheme: light dark; を完全に理解する
uhyo
3
300
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Bash Introduction
62gerente
611
210k
A Philosophy of Restraint
colly
203
16k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
A better future with KSS
kneath
238
17k
Embracing the Ebb and Flow
colly
84
4.6k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Speed Design
sergeychernyshev
27
790
KATA
mclloyd
29
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Transcript
new and old south Andrew Godwin djangocon.eu 2010
It's been almost 2 years. Lots has happened.
Migrations? Eh? A bit like a VCS, but for database
schemas.
The Beginning
1-make_tables.sql 2-add_profile.sql
YOU ARE AT VERSION 2 1-make_tables.sql 2-add_profile.sql
1-make_tables.sql 2-add_profile.sql 3-remove_pony.sql 1-make_tables.sql 2-add_profile.sql 4-add_postcode.sql
1-make_tables.sql 2-add_profile.sql 3-remove_pony.sql 1-make_tables.sql 2-add_profile.sql 4-add_postcode.sql YOU ARE AT VERSION
3 YOU ARE AT VERSION 4
1-make_tables.sql 2-add_profile.sql 3-remove_pony.sql 1-make_tables.sql 2-add_profile.sql 4-add_postcode.sql YOU ARE AT VERSION
3 YOU ARE AT VERSION 4 3-remove_pony.sql 4-add_postcode.sql
Oracle MySQL PostgreSQL MSSQL SQLite
The Early Days
Adding tables Deleting tables Everything else useful
3-remove_pony.sql 1-make_tables.sql 2-add_profile.sql 4-add_postcode.sql
Uh-oh, publicity
Closing this, as it's unlikely we'll write a model history
tracker in the near future, and django-evolution does this well - no need to reinvent the wheel in that area. “ “
Feature Creep (of the good sort)
start_field_re = re.compile(r'\s*%s\s*=\s*(.*)' % field.name) for line in source[0]: #
if the field was found during a previous iteration, # we're here because the field spans across multiple lines # append the current line and try again
cms.0001_initial cms.0002_auto_start picture.0001_initial file.0001_initial flash.0001_initial link.0001_initial snippet.0001_initial video.0001_initial twitter.0001_initial cms.0003_remove_placeholder
cms.0004_textobjects cms.0005_mptt_added_to_plugins cms.0006_apphook text.0001_initial cms.0007_apphook_longer cms.0008_redirects cms.0009_added_meta_fields cms.0010_5char_language cms.0011_title_overwrites cms.0012_publisher cms.0013_site_copy file.0003_publisher text.0003_publisher picture.0004_publisher googlemap.0001_initial link.0005_publisher flash.0003_publisher snippet.0002_publisher cms.0014_sites_removed cms.0015_modified_by_added cms.0016_author_copy cms.0017_author_removed cms.0018_site_permissions cms.0019_public_table_renames file.0004_table_rename cms.0020_advanced_permissions picture.0006_float_added teaser.0001_initial text.0004_table_rename flash.0004_table_rename link.0006_table_rename snippet.0003_table_rename googlemap.0002_table_rename picture.0005_table_rename cms.0021_publisher2 picture.0007_publisher2 cms.0022_login_required_added teaser.0002_publisher2 cms.0023_plugin_table_naming_function_changed text.0002_freeze text.0005_publisher2 picture.0002_link_rename picture.0003_freeze picture.0008_longdesc_added file.0002_freeze file.0005_publisher2 flash.0002_freeze flash.0005_publisher2 link.0002_link_rename link.0003_page_link link.0004_larger_link_names link.0007_publisher2 link.0008_mailto snippet.0004_publisher2 snippet.0005_template_added googlemap.0006_publisher2 googlemap.0007_latlng googlemap.0008_routeplaner googlemap.0009_routeplaner_title video.0002_color_mute_controller video.0003_newplayer_step1 video.0004_newplayer_step2 video.0005_newplayer_step3 video.0006_newplayer_step4 video.0007_newplayer_step5 inherit.0001_initial inherit.0002_fieldchanges
Model Freezing
Historical ORM access Automatic change detection ‘Improved’ model parsing
Sanity Dawns
Introspection Magically supports custom fields Prevents hideous migration failure
SQLite Make new table Copy data from old table Delete
old table Rename new table
Signals Speed Simplicity
1.0
MultiDB? Non-relational? Renames!
Organic Growth But it's still cleanly separated
Database Backend Dependency/ Ordering Engine Migration Runner Auto- detector
The Future
Database Backend Dependency/ Ordering Engine South in future ??? Migration
Runner Auto- detector
The Ultimate Goal
Andrew Godwin Fin. www.aeracode.org @andrewgodwin
Andrew Godwin Fin. www.aeracode.org @andrewgodwin