Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local dev docs for django-linear-migrations #10658

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

rossgray
Copy link
Contributor

Changes

I came across the awesome django-linear-migrations tool we added recently but didn't see it in our docs, which means many people might not realise it exists.

Checklist

  • Words are spelled using American English
  • Titles are in sentence case

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ✅ Ready (Inspect) Visit Preview Feb 14, 2025 3:57pm

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Just one tweak: to "Concurrent migrations"

Comment on lines 434 to 436
### Concurrent migrations

Typically the migration generated by Django will not need to be modified, however, if you're adding a new constraint, such as an index, then you need to update the migration to run concurrently, so that it doesn't create a lock on the table. (Don't worry, there is a check in our CI that will flag if this is the case)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migrations themselves are not concurrent! It's just about us using non-table-locking Postgres DDL statements, enabled by the CONCURRENTLY keyword. Proposing a bit of clarification:

Suggested change
### Concurrent migrations
Typically the migration generated by Django will not need to be modified, however, if you're adding a new constraint, such as an index, then you need to update the migration to run concurrently, so that it doesn't create a lock on the table. (Don't worry, there is a check in our CI that will flag if this is the case)
### Non-blocking migrations
Typically a migration generated by Django will not need to be modified. However, if you're adding a new constraint or index, you must tweak the migration so that it doesn't dangerously lock the affected table. We prevent locking by using the `CONCURRENTLY` keyword in Postgres DDL statements. Don't worry about this too much, a check in our CI will flag necessary tweaks as needed!

@Twixes Twixes enabled auto-merge (squash) February 14, 2025 15:42
@Twixes Twixes merged commit a7520be into master Feb 14, 2025
3 checks passed
@Twixes Twixes deleted the add-docs-for-django-linear-migrations branch February 14, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants