Last active
August 6, 2022 22:25
-
-
Save luanjpb/c68c9341f80d3dd8d43574db4cf4a9bd 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, migrations.RunPython.noop), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment