Skip to content

Instantly share code, notes, and snippets.

@mintyPT
Last active December 16, 2024 14:35
Show Gist options
  • Select an option

  • Save mintyPT/49f9a3d0fe1ab1f32b219ee41c96c79c to your computer and use it in GitHub Desktop.

Select an option

Save mintyPT/49f9a3d0fe1ab1f32b219ee41c96c79c to your computer and use it in GitHub Desktop.
Migrate charfield's choice in django
from django.db import migrations
# To get this empty migration:
# > python manage.py makemigrations --empty app_name
class Migration(migrations.Migration):
dependencies = [("app_name", "0001_abc")]
operations = [
migrations.RunSQL(
"update pipeline_sipsnapshotstatus set state='new_b' where state='new';",
"update pipeline_sipsnapshotstatus set state='new' where state='new_b';",
)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment