diff --git a/food_planner/migrations/0008_auto_20200223_1538.py b/food_planner/migrations/0008_auto_20200223_1538.py new file mode 100644 index 0000000..ed7da1a --- /dev/null +++ b/food_planner/migrations/0008_auto_20200223_1538.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.3 on 2020-02-23 14:38 + +from django.conf import settings +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('food_planner', '0007_mealplan_name'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='mealplan', + unique_together={('author', 'name')}, + ), + ] diff --git a/food_planner/models.py b/food_planner/models.py index 87c5752..531fdfe 100644 --- a/food_planner/models.py +++ b/food_planner/models.py @@ -306,3 +306,4 @@ class MealPlan(models.Model): class Meta: verbose_name = _('Meal plan') verbose_name_plural = _('Meal plans') + unique_together = ['author', 'name']