Created
August 6, 2022 21:30
-
-
Save luanjpb/835a752372e2e6b67795e3a25698b592 to your computer and use it in GitHub Desktop.
This file contains 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 characters
from django.db import migrations | |
import third_party_app.generators | |
import third_party_app.models | |
def forwards_func(apps, schema_editor): | |
""" | |
Forward migration touches every somemodel.some_field to do some shenanigans. | |
""" | |
pass | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('third_party_app', '0005_auto_20211222_2352'), | |
] | |
operations = [ | |
migrations.AlterField( | |
model_name='somemodel', | |
name='some_field', | |
field=third_party_app.models.SomeField(blank=True, db_index=True, default=third_party_app.generators.generate_some_field, help_text='Some field.', max_length=255), | |
), | |
migrations.RunPython(forwards_func), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment