transport: avoid index issues with MySQL/MariaDB.

See https://github.com/modoboa/modoboa-postfix-autoreply/issues/19
This commit is contained in:
Antoine Nguyen
2018-09-28 15:20:55 +02:00
parent 48a7586fdf
commit 493972484e
2 changed files with 22 additions and 1 deletions
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-28 13:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transport', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='transport',
name='pattern',
field=models.CharField(db_index=True, max_length=253, unique=True, verbose_name='pattern'),
),
]
+2 -1
View File
@@ -16,7 +16,8 @@ from . import backends
class Transport(models.Model):
"""Transport table."""
pattern = models.CharField(_("pattern"), unique=True, max_length=254)
pattern = models.CharField(
_("pattern"), unique=True, max_length=253, db_index=True)
service = models.CharField(_("service"), max_length=30)
next_hop = models.CharField(_("next hop"), max_length=100, blank=True)