Skip to content

Instantly share code, notes, and snippets.

@luanjpb
Created August 6, 2022 21:30
Show Gist options
  • Save luanjpb/835a752372e2e6b67795e3a25698b592 to your computer and use it in GitHub Desktop.
Save luanjpb/835a752372e2e6b67795e3a25698b592 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),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment