django-inspectional-registration icon indicating copy to clipboard operation
django-inspectional-registration copied to clipboard

Additional migration created if using registration supplement

Open gyrofx opened this issue 8 years ago • 3 comments

The manage.py makemigrationscommand created an additional migration in the registration app. This is annoying for deploying and I'm not sure if this is the expected behavior.

Migrations for 'gtaccess':
  0064_auto_20160621_1643.py:
    - Create model RegistrationSupplement
Migrations for 'registration':
  0002_auto_20160621_1643.py:
    - Remove field registration_profile from defaultregistrationsupplement
    - Delete model DefaultRegistrationSupplement

In the settings I added REGISTRATION_SUPPLEMENT_CLASS='package.to.RegistrationSupplement' but I didn't add the registration.supplements.default to my INSTALLED_APPS of settings.py because I thought the DefaultRegistrationSupplementmodel is not nedded.

But exactly that was my problem. If I add the registration.supplements.default to my INSTALLED_APPS the problem does not occur.

Long story short I'm happy now but as I mentioned I'm not sure if this is that expected behavior. I just want let you know about that.

By the way thanks for this excellent lib.

gyrofx avatar Jun 21 '16 15:06 gyrofx

I'm not sure but could you try https://github.com/lambdalisue/django-inspectional-registration/tree/issue66

lambdalisue avatar Jun 22 '16 01:06 lambdalisue

Please apologies for my late response.

First I had to add a dependency from migration 0002_default_supplement to 0001_initialmigration

0002_default_supplement.py:

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

otherwise the migrate command complains about a conflict: CommandError: Conflicting migrations detected (0002_default_supplement, 0001_initial in registration).

After that everything worked perfectly for my case.

An issue could be If someone starts without a supplement class and later he decides to use the default supplement model. It won't be generated.

gyrofx avatar Jul 20 '16 06:07 gyrofx

Thanks. I'll fix it as your modification.

An issue could be If someone starts without a supplement class and later he decides to use the default supplement model. It won't be generated.

I think then he can use --force option ;-)

lambdalisue avatar Jul 20 '16 11:07 lambdalisue