28 lines
678 B
Python
28 lines
678 B
Python
# Generated by Django 2.2.21 on 2021-05-06 12:33
|
|
from django.db import migrations
|
|
|
|
|
|
def hep_id_to_old_hep_id(apps, schema_editor):
|
|
User = apps.get_model("users", "User")
|
|
for user in User.objects.all():
|
|
user.old_hep_id = user.hep_id
|
|
user.save()
|
|
|
|
|
|
def old_hep_id_to_hep_id(apps, schema_editor):
|
|
User = apps.get_model("users", "User")
|
|
for user in User.objects.all():
|
|
user.hep_id = user.old_hep_id
|
|
user.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('users', '0026_user_old_hep_id'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(hep_id_to_old_hep_id, reverse_code=old_hep_id_to_hep_id)
|
|
]
|