--- id: django-add-default-value version: "0.10.0" license: Apache-2.0 license_treatment: permissive maintenance: dormant --- # django-add-default-value — This django Migration Operation can be used to transfer a fields default value to the database scheme. License: permissive · Maintenance: dormant · Downloads: 326.4K/mo ## What it is and what it does django-add-default-value is a Django migration operation that lets you set default values at the database level when adding new fields to existing tables. Instead of relying on Django's ORM default (which only applies to new rows created through Django), this operation runs a SQL ALTER TABLE statement to set the default in the schema itself, ensuring backward compatibility and consistency across all database access patterns. You use it by adding an AddDefaultValue operation to your migration file after the AddField operation. It supports MySQL, PostgreSQL, CockroachDB, and MSSQL. The package has been dormant since early 2022, so while it remains functional for the Django versions it was tested against, there is no active maintenance or support for newer Django releases. Use it for: - Adding a required field with a default value to an existing Django model without breaking existing code or database queries - Ensuring database-level consistency when a field default must apply to all rows, not just those created through Django ORM - Migrating legacy schemas where the database itself needs to enforce default values independent of application logic - Handling backward compatibility in production deployments where you need to add a column with a safe default without downtime ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Django migration operation to set database-level default values for fields, enabling backward-compatible schema changes when adding new columns with defaults to existing tables. Yes, if you are on Django 1.11–3.2 and need to set database-level defaults during migrations. No, if you are on a newer Django version—the package is dormant and has not been tested or updated for Django 4.0+. Check your Django version against the classifiers before installing. ## Install pip install django-add-default-value uv add django-add-default-value poetry add django-add-default-value ## Installing django-add-default-value Before you install: Low install friction with a single Django dependency. Maintenance is dormant—last release was 2022-02-02 and no commits since 2024-03-20—so expect no active support or updates for newer Django versions. License in practice: Released under Apache 2.0 (permissive), so you can use, modify, and distribute it freely in commercial and private projects without restriction. Quickstart: pip install django-add-default-value In your migration file: from django_add_default_value import AddDefaultValue operations = [ migrations.AddField(...), AddDefaultValue( model_name='my_model', name='my_field', value='my_default' ) ] Verify before relying: - Whether the package works with Django versions released after 2022 (classifiers list only up to 3.2) - Current test coverage and whether MSSQL support has been validated since the 'currently not tested' note ## Package facts - License: Apache-2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 326.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django migration default value, database schema default column, django add field with default, backward compatible django migrations, django field default to database, django-migrations, schema-management [View on SkillFed](https://skillfed.io/packages/django-add-default-value) · [View on PyPI](https://pypi.org/project/django-add-default-value/)