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

Command cs_makemigrations #116

Open
oduvan opened this issue Oct 27, 2024 · 0 comments
Open

Command cs_makemigrations #116

oduvan opened this issue Oct 27, 2024 · 0 comments
Labels
enhancement New feature or request tooling tools around the CS, allows you easier to support and easier to develop

Comments

@oduvan
Copy link
Contributor

oduvan commented Oct 27, 2024

The command generates migrations based on current DB values for the settings.

Examples

./manage.py cs_makemigrations TITLE - finds the app where the TITLE setting is stored and generates migration 0005_cs_title.py

The content for the migration is:

# Generated by django-content-settings 0.25

from django.db import migrations
from content_settings.migrate import RunImport


class Migration(migrations.Migration):
    dependencies = [
        ("content_settings", "0004_userdefined_preview"),
        ("songs", "0003_admin"),
    ]

    operations = [
        RunImport(
            {
                "settings": {
                    "TITLE": {"value": "Best Settings Framework", "version": ""},
                }
            }
        )
    ]

Addition:

  • The command can accept more than one setting name.
  • One command call can generate more than one migration if the requested settings are in different apps.
  • The command accepts --name attribute
@oduvan oduvan added the enhancement New feature or request label Oct 27, 2024
@oduvan oduvan added the tooling tools around the CS, allows you easier to support and easier to develop label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tooling tools around the CS, allows you easier to support and easier to develop
Projects
None yet
Development

No branches or pull requests

1 participant