Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Additional migration created if using registration supplement #66

Open
gyrofx opened this issue Jun 21, 2016 · 3 comments
Open

Additional migration created if using registration supplement #66

gyrofx opened this issue Jun 21, 2016 · 3 comments

Comments

@gyrofx
Copy link

gyrofx commented Jun 21, 2016

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.

@lambdalisue
Copy link
Owner

@gyrofx
Copy link
Author

gyrofx commented Jul 20, 2016

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.

@lambdalisue
Copy link
Owner

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 lambdalisue mentioned this issue Aug 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants