always use get_model in migrations
This commit is contained in:
parent
7d1786f143
commit
a59509a432
5 changed files with 3 additions and 22 deletions
|
@ -2,17 +2,15 @@
|
|||
|
||||
from django.db import migrations, models
|
||||
|
||||
from tickets.models import IssueThread
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tickets', '0005_remove_issuethread_last_activity'),
|
||||
]
|
||||
|
||||
def set_uuid(apps, schema_editor):
|
||||
import uuid
|
||||
IssueThread = apps.get_model('tickets', 'IssueThread')
|
||||
for issue_thread in IssueThread.objects.all():
|
||||
issue_thread.uuid = str(uuid.uuid4())
|
||||
issue_thread.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue