Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running migration problem #662

Open
ahmedelfateh opened this issue Jun 29, 2022 · 6 comments
Open

running migration problem #662

ahmedelfateh opened this issue Jun 29, 2022 · 6 comments
Assignees
Labels

Comments

@ahmedelfateh
Copy link

ahmedelfateh commented Jun 29, 2022

after setting up django_push_notification and adding push_notification to the app, I run the migration and this msg appere

Your models in app(s): 'push_notifications' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

and when run makemigrations, this appere

 Migrations for 'push_notifications':
  /usr/local/lib/python3.8/site-packages/push_notifications/migrations/0010_auto_20220629_1231.py
    - Alter field id on apnsdevice
    - Alter field id on gcmdevice
    - Alter field id on webpushdevice
    - Alter field id on wnsdevice

I am using the django~=3.2 / django-push-notifications==3.0.0
with python:3.8.12

what is the problem here?

@jamaalscarlett jamaalscarlett self-assigned this Jun 29, 2022
@jamaalscarlett
Copy link
Member

@ahmedelfateh This is happening because of https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field. If you started your project on Django 3.2 or newer, your settings.py file contains

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

but django push notifications uses AutoField. The fix would be to change the setting to:

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

or except the new migration.

@denizdogan
Copy link
Contributor

@jamaalscarlett Is there any reason why this migration can't just be included in the library at this point? Django 2 is not supported any longer, 3.2 is the oldest supported version, and it's LTS until April 2024.

@PureTryOut
Copy link

I too would prefer if the library just included the migration. I have no interest in a Django version lower than 3.2 and now every time I run makemigrations this migration comes up I have to remove (as it's not in my version control and thus not persistent).

@jamaalscarlett
Copy link
Member

@PureTryOut I will take a look at this tonight

@Aidar
Copy link

Aidar commented Jun 12, 2024

Any updates?

@CoderMungan
Copy link

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants