Merge pull request #43 from emtwo/17

Closes #17: Remove unique constraint on variant identifiers.
This commit is contained in:
Jared Kerim 2017-05-04 14:00:43 -04:00 коммит произвёл GitHub
Родитель cd54df7ce9 15ca46686a
Коммит d778f07004
2 изменённых файлов: 32 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-03 18:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('experiments', '0003_experiment_analysis'),
]
operations = [
migrations.AlterField(
model_name='experimentvariant',
name='name',
field=models.CharField(max_length=255),
),
migrations.AlterField(
model_name='experimentvariant',
name='slug',
field=models.SlugField(max_length=255),
),
migrations.AlterUniqueTogether(
name='experimentvariant',
unique_together=set([('slug', 'experiment')]),
),
]

Просмотреть файл

@ -26,9 +26,9 @@ class Experiment(models.Model):
class ExperimentVariant(models.Model):
experiment = models.ForeignKey(Experiment, blank=False, null=False)
name = models.CharField(
max_length=255, unique=True, blank=False, null=False)
max_length=255, blank=False, null=False)
slug = models.SlugField(
max_length=255, unique=True, blank=False, null=False)
max_length=255, blank=False, null=False)
is_control = models.BooleanField(default=False)
description = models.TextField(default='')
threshold = models.PositiveIntegerField(default=0)
@ -40,3 +40,4 @@ class ExperimentVariant(models.Model):
class Meta:
verbose_name = 'Experiment Variant'
verbose_name_plural = 'Experiment Variants'
unique_together = ('slug', 'experiment')