Ajout d'un index sur Account.trigramme

En fait inutile car déjà créé du fait de la contrainte d'unicité
This commit is contained in:
Aurélien Delobelle 2016-08-04 17:38:58 +02:00
parent 5b3613b6f6
commit e9bbb35e66
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('kfet', '0007_auto_20160804_0641'),
]
operations = [
migrations.AlterField(
model_name='account',
name='trigramme',
field=models.CharField(unique=True, validators=[django.core.validators.RegexValidator(regex='^[^a-z]{3}$')], db_index=True, max_length=3),
),
]

View file

@ -21,7 +21,8 @@ class Account(models.Model):
trigramme = models.CharField(
unique = True,
max_length = 3,
validators = [RegexValidator(regex='^[^a-z]{3}$')])
validators = [RegexValidator(regex='^[^a-z]{3}$')],
db_index = True)
balance = models.DecimalField(
max_digits = 6, decimal_places = 2,
default = 0)