adamchainz / gargoyle

:radio_button: Feature switches in Django
Apache License 2.0
109 stars 19 forks source link

Missing/uncommitted migrations file #70

Closed frewsxcv closed 8 years ago

frewsxcv commented 8 years ago

It looks like there's a missing migrations file. Running on a fresh install:

> python hub/manage.py makemigrations
Migrations for 'gargoyle':
  0002_auto_20160502_1842.py:
    - Alter field status on switch
frewsxcv commented 8 years ago

Contents of the migration file:

# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 18:42
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('gargoyle', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='switch',
            name='status',
            field=models.PositiveSmallIntegerField(choices=[(1, 'Disabled'), (2, 'Selective'), (3, 'Global'), (4, 'Inherit')], default=1),
        ),
    ]
frewsxcv commented 8 years ago

To prevent this from happening in the future, you could add:

python manage.py makemigrations --exit; test "$?" = 1

to the continuous integration to check if any migrations need to be added.

adamchainz commented 8 years ago

Thanks for reporting! It looks like this was added in e921e7d36bce4fcc8283999f05874d5509ebe0d0 with the confusion between str and unicode getting fixed. I think we're going to have to ship the (no-op!) migration to shift the constants from str/bytes to unicode/str.

adamchainz commented 8 years ago

Published on pip as version 1.2.4: https://pypi.python.org/pypi/gargoyle-yplan

For project, if you've migrated your database with the migration you generated, then it will need reversing before you upgrade.

frewsxcv commented 8 years ago

Thanks for the fast turn-around time, I really appreciate it! 🎉