Make source label field unique.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
20
mayan/apps/sources/migrations/0019_auto_20180803_0440.py
Normal file
20
mayan/apps/sources/migrations/0019_auto_20180803_0440.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-08-03 04:40
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('sources', '0018_auto_20180608_0057'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='source',
|
||||
name='label',
|
||||
field=models.CharField(db_index=True, max_length=64, unique=True, verbose_name='Label'),
|
||||
),
|
||||
]
|
||||
@@ -51,7 +51,9 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Source(models.Model):
|
||||
label = models.CharField(max_length=64, verbose_name=_('Label'))
|
||||
label = models.CharField(
|
||||
db_index=True, max_length=64, unique=True, verbose_name=_('Label')
|
||||
)
|
||||
enabled = models.BooleanField(default=True, verbose_name=_('Enabled'))
|
||||
|
||||
objects = InheritanceManager()
|
||||
|
||||
Reference in New Issue
Block a user