fix(migrations): Rename the migration back due to InconsistentMigrationHistory otherwise

This commit is contained in:
Arkadiy Korotaev 2020-11-10 18:24:16 +01:00
parent 6dd3b07dad
commit e9a2313d93
No known key found for this signature in database
GPG Key ID: 4BD092DD84540FAB
2 changed files with 6 additions and 4 deletions

View File

@ -8,20 +8,22 @@ def clear_secret_keys(apps, schema_editor):
db_alias = schema_editor.connection.alias
for ticket in Ticket.objects.using(db_alias).all():
ticket.secret_key=''
ticket.save()
ticket.secret_key = ''
ticket.save()
class Migration(migrations.Migration):
dependencies = [
('helpdesk', '0018_fix_migrations'),
('helpdesk', '0018_ticket_secret_key'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='secret_key',
field=models.CharField(default=helpdesk.models.mk_secret, max_length=36, verbose_name='Secret key needed for viewing/editing ticket by non-logged in users'),
field=models.CharField(default=helpdesk.models.mk_secret, max_length=36,
verbose_name='Secret key needed for viewing/editing ticket by non-logged in users'),
),
migrations.RunPython(clear_secret_keys),
]