django-migrations

Generate and validate Django database migrations with conflict resolution.

693|111|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill django-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-migrations
Source: https://github.com/PostHog/posthog-foss/tree/main/.agents/skills/django-migrations
Command: npx skills add https://github.com/PostHog/posthog-foss --skill django-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating, reviewing, and applying Django database migrations, ensuring safety and preventing common pitfalls like merge conflicts or data loss.

Core Features & Use Cases

  • Migration Generation: Safely generates new Django migrations.
  • Conflict Resolution: Provides a workflow for rebasing and resolving migration merge conflicts.
  • Safety Checks: Enforces safety rules for risky changes (e.g., dropping columns, adding NOT NULL constraints).
  • Use Case: When adding a new feature that requires database schema changes, use this Skill to generate the migration, apply safety checks, and resolve any conflicts that arise during a team merge.

Quick Start

Use the django-migrations skill to generate a new migration for the 'auth' app.

Frequently Asked Questions about django-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve Django migration merge conflicts safely?

Django migration merge conflicts are resolved using a structured rebasing workflow that validates migration sequences and enforces safety rules to prevent data loss during team merges. This ensures conflicting schema changes synchronize without breaking the database state.

What is the best way to apply non-blocking schema changes in Django?

Non-blocking schema changes in Django are applied using multi-phase rollouts and data backfills. This method adheres to specific safety rules for risky Postgres operations, ensuring database availability is maintained while the schema evolves.

How do I handle risky Django migrations like dropping columns or adding NOT NULL constraints?

Risky Django migrations like dropping columns or adding NOT NULL constraints are handled through enforced safety checks and multi-phase rollouts. This validates the migration sequence and prevents common pitfalls like blocking database operations or data loss.

Does this Django migration workflow support data backfills for Postgres?

Yes, the Django migration workflow supports data backfills within Postgres environments. It manages database migrations with a focus on safety, allowing you to perform data backfills and model moves without blocking normal database operations.

When do I need to use a multi-phase rollout for a Django database migration?

A multi-phase rollout is needed for a Django database migration when executing risky schema changes or large data backfills. This process safely applies non-blocking changes by validating migration sequences and adhering to strict safety rules.