From 1a428e7d2928729eae3cddf6173325556a372d97 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 24 Jun 2016 13:54:37 -0500 Subject: [PATCH] gitlab bot: make project_id unique=True --- .../migrations/0002_auto_20160624_1354.py | 19 +++++++++++++++++++ dr_botzo/gitlab_bot/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 dr_botzo/gitlab_bot/migrations/0002_auto_20160624_1354.py diff --git a/dr_botzo/gitlab_bot/migrations/0002_auto_20160624_1354.py b/dr_botzo/gitlab_bot/migrations/0002_auto_20160624_1354.py new file mode 100644 index 0000000..8e026bb --- /dev/null +++ b/dr_botzo/gitlab_bot/migrations/0002_auto_20160624_1354.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('gitlab_bot', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='gitlabprojectconfig', + name='project_id', + field=models.CharField(unique=True, max_length=64), + ), + ] diff --git a/dr_botzo/gitlab_bot/models.py b/dr_botzo/gitlab_bot/models.py index 78211e4..b21c685 100644 --- a/dr_botzo/gitlab_bot/models.py +++ b/dr_botzo/gitlab_bot/models.py @@ -24,7 +24,7 @@ class GitlabProjectConfig(models.Model): """Maintain settings for a particular project in GitLab.""" gitlab_config = models.ForeignKey('GitlabConfig', null=True) - project_id = models.CharField(max_length=64) + project_id = models.CharField(max_length=64, unique=True) manage_merge_request_code_reviews = models.BooleanField(default=False) code_reviews_necessary = models.PositiveSmallIntegerField(default=0)