Last active
December 16, 2024 14:35
-
-
Save mintyPT/49f9a3d0fe1ab1f32b219ee41c96c79c to your computer and use it in GitHub Desktop.
Revisions
-
mintyPT revised this gist
Dec 16, 2024 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,8 @@ # Generate an empty migration: # > python manage.py makemigrations --empty <app_name> # # This will migration the value in the `state` field from `new` to `new_b` # (and back if necessary). from django.db import migrations -
mintyPT revised this gist
Dec 16, 2024 . 1 changed file with 13 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,21 @@ # If you change some field's choice, django will not migrate the value at # the database level. You need to do it. # # Generate an empty migration: # > python manage.py makemigrations --empty <app_name> # # Migration from `new` to `new_b` (and back if necessary). from django.db import migrations class Migration(migrations.Migration): dependencies = [("<app_name>", "0001_abc")] operations = [ migrations.RunSQL( "update <app_name>_<table> set state='new_b' where state='new';", "update <app_name>_<table> set state='new' where state='new_b';", ) ] -
mintyPT revised this gist
Dec 16, 2024 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ from django.db import migrations # To get this empty migration: -
mintyPT renamed this gist
Dec 16, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mintyPT created this gist
Dec 16, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Generated by Django 4.2.17 on 2024-12-16 13:48 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';", ) ]