Skip to content

Commit

Permalink
Changes PriceHistory unique together.
Browse files Browse the repository at this point in the history
Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information
mkouhei committed Aug 22, 2016
1 parent 1644199 commit eb2f7af
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions backyard/inventory/migrations/0003_auto_20160822_2146.py
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 21:46
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('inventory', '0002_auto_20160725_1254'),
]

operations = [
migrations.AlterUniqueTogether(
name='pricehistory',
unique_together=set([('product', 'registered_date', 'shop')]),
),
]
2 changes: 1 addition & 1 deletion backyard/inventory/models/price_history.py
Expand Up @@ -24,7 +24,7 @@ class PriceHistory(BaseHistory):

class Meta(object):
"""Meta data."""
unique_together = ('product', 'registered_date')
unique_together = ('product', 'registered_date', 'shop')

def __str__(self):
return '{0} {1}'.format(self.product, self.price)

0 comments on commit eb2f7af

Please sign in to comment.