Commit 457a9cc9 by Clinton Blackburn

Merge pull request #472 from edx/revert-463-index-timestamped-models

Revert "Add indexes to all TimeStampedModels to match their default ordering"
parents a137a7fa 8fea522b
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('refund', '0001_squashed_0002_auto_20150515_2220'),
]
operations = [
migrations.AlterIndexTogether(
name='refund',
index_together=set([('modified', 'created')]),
),
migrations.AlterIndexTogether(
name='refundline',
index_together=set([('modified', 'created')]),
),
]
......@@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('refund', '0002_auto_20151211_1417'),
('refund', '0001_squashed_0002_auto_20150515_2220'),
]
operations = [
......
......@@ -58,10 +58,6 @@ class StatusMixin(object):
class Refund(StatusMixin, TimeStampedModel):
"""Main refund model, used to represent the state of a refund."""
class Meta(TimeStampedModel.Meta):
index_together = ["modified", "created"]
order = models.ForeignKey('order.Order', related_name='refunds', verbose_name=_('Order'))
user = models.ForeignKey('core.User', related_name='refunds', verbose_name=_('User'))
total_credit_excl_tax = models.DecimalField(_('Total Credit (excl. tax)'), decimal_places=2, max_digits=12)
......@@ -226,10 +222,6 @@ class Refund(StatusMixin, TimeStampedModel):
class RefundLine(StatusMixin, TimeStampedModel):
"""A refund line, used to represent the state of a single item as part of a larger Refund."""
class Meta(TimeStampedModel.Meta):
index_together = ["modified", "created"]
refund = models.ForeignKey('refund.Refund', related_name='lines', verbose_name=_('Refund'))
order_line = models.ForeignKey('order.Line', related_name='refund_lines', verbose_name=_('Order Line'))
line_credit_excl_tax = models.DecimalField(_('Line Credit (excl. tax)'), decimal_places=2, max_digits=12)
......
......@@ -15,9 +15,6 @@ class Invoice(TimeStampedModel):
history = HistoricalRecords()
class Meta(TimeStampedModel.Meta):
index_together = ["modified", "created"]
def __str__(self):
return 'Invoice {id} for order number {order}'.format(id=self.id, order=self.basket.order.number)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment