Skip to content

Instantly share code, notes, and snippets.

@luanjpb
Last active August 6, 2022 22:25
Show Gist options
  • Save luanjpb/c68c9341f80d3dd8d43574db4cf4a9bd to your computer and use it in GitHub Desktop.
Save luanjpb/c68c9341f80d3dd8d43574db4cf4a9bd to your computer and use it in GitHub Desktop.
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