Skip to content

Commit e361093

Browse files
committed
Stop generation of unwanted migrations
Fix issue with additional migrations being generated upon change of coupon types setting byteweaver#24
1 parent 28c1413 commit e361093

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

coupons/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
1818
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
1919
('value', models.IntegerField(help_text='Arbitrary coupon value', verbose_name='Value')),
2020
('code', models.CharField(help_text='Leaving this field empty will generate a random code.', unique=True, max_length=30, verbose_name='Code', blank=True)),
21-
('type', models.CharField(max_length=20, verbose_name='Type', choices=[(b'monetary', b'Money based coupon'), (b'percentage', b'Percentage discount'), (b'virtual_currency', b'Virtual currency')])),
21+
('type', models.CharField(max_length=20, verbose_name='Type', choices=settings.COUPONS_COUPON_TYPES)),
2222
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
2323
('redeemed_at', models.DateTimeField(null=True, verbose_name='Redeemed at', blank=True)),
2424
('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text='You may specify a user you want to restrict this coupon to.', null=True, verbose_name='User')),

coupons/migrations/0004_auto_20151105_1456.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Migration(migrations.Migration):
2828
migrations.AlterField(
2929
model_name='coupon',
3030
name='type',
31-
field=models.CharField(choices=[('monetary', 'Money based coupon'), ('percentage', 'Percentage discount'), ('virtual_currency', 'Virtual currency')], verbose_name='Type', max_length=20),
31+
field=models.CharField(choices=settings.COUPONS_COUPON_TYPES, verbose_name='Type', max_length=20),
3232
),
3333
migrations.AddField(
3434
model_name='couponuser',

0 commit comments

Comments
 (0)