Skip to content

Instantly share code, notes, and snippets.

@ilya-muhortov
Created June 6, 2019 12:10
Show Gist options
  • Save ilya-muhortov/5ddd137032b57316ca7e4a1be5379a98 to your computer and use it in GitHub Desktop.
Save ilya-muhortov/5ddd137032b57316ca7e4a1be5379a98 to your computer and use it in GitHub Desktop.
def migrate_code(apps, schema_editor):
Model = apps.get_model('App', 'ModelName')
def reverse_code(apps, schema_editor):
return
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.RunPython(migrate_code, reverse_code=reverse_code)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment