~/talk

Beyond the Basics of Migrations

Talkat DjangoCon US 2023 · 2023-10-16..10-20· [django, databases]
slides:none on file

Explains that Django migrations are one Migration class with dependencies and operations, shows autogenerated ops like CreateModel, RenameField and AlterField, and demonstrates editing migrations to force a rename or to add a data migration using migrations.RunPython. Shows using apps.get_model to access the historical model, creating an empty migration with `--empty`, and providing a reverse function or noop. Gives concrete cautions about losing data, renaming custom migration filenames, and avoiding migrations for repeatable cleanups.

AI-written summary · about

  1. 0:00Django migrations intro
  2. 1:06Core structure
  3. 3:14Auto-generated migration
  4. 5:23Modify migrations for changes
  5. 7:11Edit auto-generated migrations
  6. 9:38Custom migrations from scratch
  7. 11:44Data migration function
  8. 15:36Reverse migrations best practices
  9. 18:09Custom migrations best practices
  10. 21:39Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.