fix(migrations): Fix the 0034 migration for Postgres

This commit is contained in:
Arkadiy Korotaev 2020-11-10 17:41:10 +01:00
parent 455dd0ab2e
commit 6dd3b07dad
No known key found for this signature in database
GPG Key ID: 4BD092DD84540FAB

View File

@ -7,6 +7,7 @@ def forwards_func(apps, schema_editor):
EmailTemplate = apps.get_model("helpdesk", "EmailTemplate")
db_alias = schema_editor.connection.alias
EmailTemplate.objects.using(db_alias).create(
id=EmailTemplate.objects.order_by('-id').first().id + 1, # because PG sequences are not reset
template_name='merged',
subject='(Merged)',
heading='Ticket merged',
@ -23,6 +24,7 @@ From now on, please answer on this ticket, or you can include the tag {{ ticket.
locale='en'
)
EmailTemplate.objects.using(db_alias).create(
id=EmailTemplate.objects.order_by('-id').first().id + 1, # because PG sequences are not reset
template_name='merged',
subject='(Fusionné)',
heading='Ticket Fusionné',